How To: Match Folders and File Names in Titan Event Conditions
How To: Match Folders and File Names in Titan Event Conditions
Applies to: Titan SFTP and Titan MFT server events that use the Directory (folder) and File name conditions, for example a File Upload / Write Successful event.
Event conditions decide which uploads start your event actions (PGP decrypt, move, run a script, send an email, and so on). A pattern that is off by one character, such as a trailing backslash or a * in the wrong place, can make an event fire for every file on the server or for none at all. This article explains exactly what each condition compares against, how wildcards work, and gives tested examples.
Quick answer
To run an event only for files uploaded directly into a folder (not its subfolders), use:
- Directory condition:
*\MFTUsers\partner\IN(no backslash or*at the end) - File name condition:
*.pgp(or whatever file names you want) - Event logic (last page of the event wizard): All conditions are true
1. What each condition is compared with
| Condition | Compared with | Example, for an upload of F:\MFTUsers\partner\IN\claims_837.dat.pgp |
|---|---|---|
| Directory | The folder the file was uploaded to (its parent folder), without a trailing backslash | F:\MFTUsers\partner\IN |
| File name | The full path of the file. A pattern with no \ in it is matched against the file name only (see section 4). |
F:\MFTUsers\partner\IN\claims_837.dat.pgp |
Both are the physical path on the server (for example F:\..., \\fileserver\share\... or /data/... on Linux), not the path the user sees in their SFTP client (such as /IN).
2. Wildcard rules
*matches any characters within one folder or file name. It does not cross a\. For example,IN\*matchesIN\Archivebut notIN\Archive\2026.**matches any number of folder levels, including none.- A pattern that starts with
*\is treated as**\, meaning "anywhere on any drive or share". So*\MFTUsers\partner\INmatchesF:\MFTUsers\partner\INand alsoE:\Data\MFTUsers\partner\IN. - Only
*and**are wildcards. Treat every other character, including?, as literal text. - Matching is not case-sensitive:
*.PGPmatchesfile.pgp. \and/are interchangeable in patterns.- If your pattern contains
**anywhere, Titan uses it exactly as written. In that case, also start it with**\(not*\) when you mean "anywhere". Don't include a drive letter or\\server\shareprefix in such a pattern:F:\**\INnever matches anything; use**\INinstead.
3. Directory condition examples
Example folders. Each row shows the folder a file was uploaded into.
- A:
F:\MFTUsers\partner\IN - B:
F:\MFTUsers\partner\IN\Archive - C:
F:\MFTUsers\partner\IN\Archive\2026 - D:
F:\MFTUsers\partner\INBOX - E:
E:\Data\MFTUsers\partner\IN
| Directory pattern | A IN |
B IN\Archive |
C IN\Archive\2026 |
D INBOX |
E E:\Data\...\IN |
Use it for |
|---|---|---|---|---|---|---|
*\MFTUsers\partner\IN |
Yes | No | No | No | Yes | Recommended. Files directly in IN only. |
*\MFTUsers\partner\IN\ |
No | Yes | Yes | No | No | Don't use. A trailing backslash matches every subfolder of IN at any depth, but never IN itself. |
*\MFTUsers\partner\IN\* |
No | Yes | No | No | No | Files one level below IN only (common mistake when IN itself is intended). |
**\MFTUsers\partner\IN\** |
No | Yes | Yes | No | No | Files in any subfolder of IN, at any depth, but not IN itself. |
*\MFTUsers\partner\INand **\MFTUsers\partner\IN\**(two entries in the same condition) |
Yes | Yes | Yes | No | Yes (IN itself only) | IN and all of its subfolders. |
F:\MFTUsers\partner\IN |
Yes | No | No | No | No | One exact folder on one drive. |
MFTUsers\partner\IN |
Yes | No | No | No | No | Anchored at the root of the drive or share (no leading *). |
*\partner\IN* |
Yes | No | No | Yes | Yes | Careful: a * after the name also matches INBOX, IN2, IN_old and so on. |
*\IN |
Yes | No | No | No | Yes | Any folder named IN for any user. Usually too broad. |
4. File name condition examples
Examples for an upload of F:\MFTUsers\partner\IN\claims_837p.dat.pgp:
| File name pattern | Matches? | Notes |
|---|---|---|
*.pgp |
Yes | Any file ending in .pgp, in any folder. |
*837*.dat.pgp |
Yes | Name contains 837 and ends in .dat.pgp. A pattern with no \ only looks at the file name, so a folder named 837 doesn't count. |
*.dat |
No | The pattern must match the end of the name. This file ends in .pgp. |
*.* |
Yes | Matches every file, including names with no dot (for example README). With "Any condition is true" this fires the event for every upload on the server. |
* |
Yes | Every file. Same as *.*. |
*\partner\IN\*.pgp |
Yes | A pattern containing a folder path is matched against the full path. This one-condition alternative matches .pgp files directly in IN, but not in IN\Archive. |
*.filepart |
(temporary name) | Some clients (for example WinSCP) upload as name.filepart and rename it afterwards. See Troubleshooting. |
5. Combining patterns and conditions
- Several patterns in one condition are combined with OR: the condition is met if any pattern matches. If you choose Does not match any, the condition is met only when none of them match.
- Several conditions in one event are combined using the setting on the last page of the event wizard:
- All conditions are true (AND): use this when you want a folder and a file name to match. This is what you want in most cases.
- Any condition is true (OR): the event runs if only one condition matches. For example, a Directory condition of
*\partner\INplus a File name condition of*.*with "Any" runs the event for every file uploaded anywhere on the server.
Watch out: if the event logic is "Any" and the Directory pattern is wrong, the event can still appear to work because the file name condition matches. Once you switch to "All", the wrong Directory pattern stops the event completely. Check the Directory pattern with the table in section 3 before changing the logic.
6. Troubleshooting
- See what matched: with the server log level set to Debug, every evaluation is logged as a
Testing Condition Poco=[...]line followed byconditionMet=TrueorconditionMet=False. Upload one test file and search the log for those lines to see which pattern failed. The same line also showsresult.Result=, which is the condition's final answer. When Does not match any is selected,conditionMetis the value before it is reversed. - Temporary upload names: if the client uploads to a temporary name (such as
.filepart) and renames it afterwards, a pattern like*.pgpwon't match the upload. In WinSCP, turn off Preferences > Transfer > Endurance > Transfer to temporary filename, or add a rename event. - Files that are already waiting aren't re-evaluated after you fix a condition. Re-upload them (or move them out and back in over SFTP) to trigger the event.
- Slow or "batched" processing: event actions with Wait enabled hold up the actions of other events matched by the same upload until they finish or time out. An event that fires more broadly than intended (often "Any" with
*.*) can delay unrelated events.
Related articles
- How To: Create a File Uploaded Event
- How To: Move Files With An Event
- How To: Launch a Script with an Event