Limit Uploaded Files To Regular Expression
This folder setting limits file names to a specified regular expression, enforcing a naming pattern on incoming files.
It supports automation and downstream-system compatibility by restricting incoming files to specific names, formats, or extensions. It is useful when files must follow a required convention, including document collection through Inboxes and Share Links, and uploads from internal systems, external systems, remote servers, vendors, and users.
This restriction applies to any action that places files or folders directly into the folder, including uploads, Inboxes, Share Links, renames that result in restricted filenames or extensions, manual copy or move actions, and automated processes like Syncs and Automations.
Whenever the restriction is active, filenames containing a line feed (\n) or carriage return (\r) are rejected, even if the configured regular expression would match them. This prevents a filename from passing the rule because just one line matches: the ^ and $ anchors can match line boundaries, so a name with an allowed extension on one line could otherwise hide a disallowed suffix on the next. Uploads, moves, and copies of these files return the error "This filename is not allowed in this folder".
This rule applies to all subfolders unless explicitly overridden at a deeper level. The newline check follows the same folder inheritance and Workspace scope as the regular-expression restriction. It does not impose a newline ban on folders without an active restriction.
If you want to limit uploaded files to a certain file name length, use Limit Uploaded Files to File Name Length. Related folder settings include Limit Uploaded Files to Certain File Extensions and Automatically Rename Uploaded Files.
Moving or copying files or folders into restricted folders fails when the destination path has filename-related restrictions that are stricter than the source path, including regular-expression filename rules.
Example Regular Expressions
The patterns below cover common naming requirements. Build your own regex against your specific naming convention.
For single-line filenames, partial matches are allowed: ^Document- matches Document-report.txt without matching the rest of the filename.
Restrict Filenames to Start With a Number
To allow only filenames that begin with a number, use ^[0-9].*$. This fits numeric naming conventions for invoices, order numbers, or batch files.
Enforce a Case-Insensitive Invoice Naming Format
To require an invoice naming structure like INV-1234.pdf, use (?i)^INV-\d{4}\.pdf$. The pattern accepts uppercase or lowercase while enforcing the structure.
Limit Filenames to Lowercase Letters, Numbers, and Specific Symbols
To allow only lowercase letters, numbers, dots, underscores, and hyphens, use ^[a-z0-9._-]+$. This fits environments where uppercase letters are not allowed.
Restrict Filenames to a Maximum Length
To cap filenames at a specific length, use ^.{1,20}$ for a maximum of 20 characters. The folder setting Limit Uploaded Files by File Name Length achieves a similar result.
Allow Filenames With Alphanumeric Characters and a Single Dot for Extensions
To require filenames containing only letters, numbers, spaces, underscores, and hyphens with a single dot for the extension, use ^[a-zA-Z0-9 _-]+\.[a-zA-Z0-9]+$.
Allow Only Specific File Types
To restrict uploads to specific extensions like .jpg, .png, or .txt, use ^.*\.(jpg|png|txt)$. The folder setting Limit Uploaded Files to Certain Extensions achieves a similar result.
With this pattern, document.txt is allowed, while document.txt\npayload.exe is rejected. In this example, \n represents an actual line feed in the filename.
Prevent Filenames From Containing Restricted Characters
To block filenames containing characters that are disallowed on some operating systems, such as < > : " / \ | ? *, use ^[^<>:"/\\|?*]+$. This prevents storage errors on Windows-based systems and other restricted environments.
Enforce a Specific File Name Format
To require the naming pattern invoice_YYYY-MM-DD.pdf, use ^invoice_\d{4}-\d{2}-\d{2}\.pdf$. The pattern accepts files like invoice_2026-02-01.pdf and rejects anything else.
Allow Only Numeric File Names With a Specific Extension
To restrict uploads to numeric file names ending in .log, use ^\d+\.log$. The pattern accepts 12345.log and rejects filenames containing letters.
Overriding Settings in Subfolders or Excluding Subfolders Entirely
Subfolders can use different regular-expression filename rules by overriding the parent folder's settings. An administrator with the appropriate permissions can configure these restrictions at the subfolder level to enforce unique naming requirements or opt out of inherited rules. Disabling the inherited restriction also disables its newline check; replacing it with another active regular expression keeps the newline check in effect.
Changing the Setting on the Root Folder
When this setting is on the site's root folder, Root Folder Settings can allow only Site Administrators to change it. Folder admins can still see the setting but cannot change it.
Applying the Setting in Every Workspace
When this setting is on the site's root folder, Root Folder Settings can also make it apply in every Workspace on the site, including Workspaces created later.
Workspace Administrators can still define a different regular-expression rule on their Workspace's root folder or subfolders to accommodate the naming conventions of their own workflows. That rule takes precedence within its scope, even when it allows filenames the site-root rule blocks. Only a Site Administrator can create, change, or remove an exception that disables the inherited site-root regular-expression restriction entirely.
Adding the Setting to Every Child Site
A Child Site Management Policy can add this setting to the root folder of every Child Site it covers. While the setting is part of a policy, nobody on the Child Site can change it.