Renaming Uploaded Files
The Rename Uploaded Files Folder Setting automatically transforms filenames as files arrive, before they are saved to the destination folder. Use it to enforce naming conventions, strip unwanted vendor prefixes or system-generated identifiers, embed metadata like the upload date or folder name, or restructure filenames entirely using pattern matching with capture groups.
The Rename Uploaded Files setting provides three tools that can be used independently or in combination: a Filename Pattern for token-based transformations, Replace Text in Filename for literal string substitution, and Replace Text in Filename by Regular Expression for pattern-based restructuring. When more than one is configured, they always run in a fixed order.
Folder Administrators, Workspace Administrators, and Site Administrators can configure this setting on any folder they administer. The Applies to Subfolders recursion option controls whether the behavior is limited to the configured folder (This folder only) or extends to all subfolders beneath it (This folder and all subfolders). When applied to all subfolders, a separate rule configured on a subfolder takes precedence for that subfolder.
This folder setting can produce incomplete or zero-byte files when uploads arrive via certain WebDAV clients. Avoid configuring it on folders that WebDAV clients will upload to; we recommend using the Desktop App instead of WebDAV to prevent these issues.
Common Use Cases for Rename Uploaded Files
Prefix Date or Timestamp to Filename
Use the Filename Pattern to add the uploaded date as a prefix on the file.
Set the Filename Pattern to %Y-%m-%d-%Ff. This translates to "the current year-month-day" values, a hyphen "-", followed by the original filename and extension. A file named invoice.csv, uploaded on April 27, 2025, is saved as 2025-04-27-invoice.csv.
Append a Vendor ID from Parent Folder to Filename
Another use for the Filename Pattern is to add a parent folder's name to an uploaded filename. When many counterparties are uploading files with the same name, including their unique IDs in filenames makes it easy to track who submitted each file.
Set the Filename Pattern to %Fb-%p2%Fe. This translates to "the original filename without the extension", a hyphen "-", the name of the parent folder's parent folder, then the original extension. The uploaded file Partners/213/incoming/batch_021132.dat is saved as batch_021132-213.dat.
Remove a Known Prefix or Suffix
Use Replace Text in Filename to strip unwanted text that external systems include in filenames.
Set Text to Find in File Name to ACME_ and leave Replace With blank. This instructs Files.com to find the text ACME_ in the filename and remove it. A file named ACME_quarterly_report.csv is instead saved as quarterly_report.csv.
Reorder Structured Filename Components
Use Replace Text in Filename by Regular Expression to rearrange parts of a filename that follow a predictable structure.
Set the Filename Pattern to %Ff to pass the original filename through unchanged. Then set Regular Expression to Find in File Name to ^(?<date>\d{4}-\d{2}-\d{2})-(?<name>.*)\.csv$ and Replacement Pattern to ${name}-${date}.csv. This captures the date and name portions separately and reassembles them in the desired order. With this setup, a file named 2026-04-27-report.csv is saved as report-2026-04-27.csv.
Add a Date Prefix and Remove a Vendor Tag in One Pass
Use the Filename Pattern and Replace Text in Filename together to apply a date prefix and strip a vendor tag in a single operation.
Set the Filename Pattern to %Y-%m-%d-%Ff, set Text to Find in File Name to VND-, and leave Replace With blank.
Because Filename Pattern is the first tool to run, a file named VND-report.csv is first processed as 2026-04-27-VND-report.csv. Then, the Replace Text in Filename removes the VND-. The Rename Uploaded Files setting applies both steps internally before saving the file, so the activity log only shows the final result: 2026-04-27-report.csv.
Normalize Date Formats from Multiple Sources
Use Replace Text in Filename by Regular Expression to standardize date separators when files arrive from systems that format dates differently.
Set Regular Expression to Find in File Name to ^(\d{4})[.\-](\d{2})[.\-](\d{2}) and Replacement Pattern to $1-$2-$3. This matches any date-like prefix using dots or hyphens as separators and rewrites it with hyphens. Using these settings, a file named 2026.04.27_report.csv is saved as 2026-04-27_report.csv.
Filename Pattern
The Filename Pattern field uses token placeholders that are replaced with dynamic values at upload time, such as the current date, the original filename, or the name of the folder the file was uploaded to.
Supported Filename Pattern Placeholders
Supported patterns to automatically rename the files upon upload are:
| Pattern | Details |
|---|---|
%Fp | Original filename with extension, spaces removed, converted to lower case and non ASCII characters normalized to ASCII to ensure widest compatibility. |
%Ff | Original filename with extension. |
%Fn | Original filename without non-alphanumeric characters, with extension. |
%Fe | Original extension only. |
%Fb | Original basename without extension. |
%Fl | Converts upper case letters in your base filename to lower case. |
%p1, %p2, %p3, ... | Name of the folder configured with this rename action. The folder name comes from the source path and counts upward from the matched file.
|
%P1, %P2, %P3, ... | Name of the folder configured with this rename action. The folder name is taken from the source path and counted downward from the root. %P1 represents the top level folder. |
%Y, %m, %d, %H, %M, %S | Time related patterns. The time-related tokens are always evaluated as of the time of upload. |
Time Zone
The optional Time Zone field sets the time zone used when evaluating time-related tokens such as %Y, %m, and %d in the Filename Pattern. Accepts any time zone name (e.g. Eastern Time (US & Canada)) or a UTC offset (e.g. -05:00).
If Time Zone is left blank, time-related tokens are evaluated in UTC.
Replace Text in Filename
The Replace Text in Filename option allows you to replace specific text within the uploaded filename before the file is saved.
Files.com searches the filename for the text entered in Text to Find in File Name and replaces it with the value entered in Replace With.
If Replace With is left blank, the matching text is removed from the filename entirely.
Replace Text in Filename by Regular Expression
The Replace Text in Filename by Regular Expression option provides a more powerful alternative to simple string replacement. Instead of matching a fixed string, you define a regex pattern that describes the shape of the text to find, and a replacement template that can reference captured portions of the original filename.
Regular Expression to Find in File Name contains the regex pattern (Ruby/JavaScript-flavor) to match against the filename. Use named capture groups ((?<name>...)) or positional capture groups ((...)) to isolate portions of the filename for reuse in the replacement.
Replacement Pattern holds the replacement template. Reference named capture groups with \k<name> or ${name}, and positional capture groups with \1 or $1.
If the Replacement Pattern is left blank, any text matched by the pattern is removed from the filename.
You cannot save the Rename Uploaded Files Setting if the Regular Expression to Find in File Name contains an invalid pattern.
Transformation Order
The three parts of this behavior always run in the same order:
- Filename Pattern is evaluated first. Any filename tokens (
%Ff,%Fb,%Fe, etc.), time tokens, and path tokens (%p1,%p2,%P1, etc.) are evaluated and substituted into the filename. - Replace Text in Filename runs next, against the result of the Filename Pattern.
- Replace Text in Filename by Regular Expression runs last, against the result of the previous two steps.
To use only the Replace Text in Filename or Replace Text in Filename by Regular Expression options without modifying the filename pattern, set the Filename Pattern to %Ff to pass the original filename through unchanged.
WebDAV Related Issues for Rename Uploaded Files
WebDAV isn't consistently implemented across clients and we have found that some WebDAV clients do not perform atomic uploads. This causes the Rename Uploaded Files feature to receive partially uploaded files rather than the complete file, causing data loss and zero byte files.
We strongly recommend using our Desktop App on desktop computers, rather than the built-in WebDAV client, so that partial data isn't uploaded into folders that have Folder Settings configured for them.
Get The File Orchestration Platform Today
4,000+ organizations trust Files.com for mission-critical file operations. Start your free trial now and build your first flow in 60 seconds.
No credit card required • 7-day free trial • Setup in minutes