Patterns for file upload validation

Checking a file's extensions during file upload is a common requirement. TMT Validator offers a few built in patterns that ensure a file uses the required extension, and the file name does not contain spaces nor special characters.

If you need an additional custom pattern, all you have to do is to write a custom regular expression that satisfies your requirements and define a custom validation pattern using JavaScript (see custom pattern sample)

Large files may take a long time to upload. It is important to provide a method to avoid multiple submits during this time. The script automatically prevents this by disabling all the submit buttons as soon as the form validates. For a better user experience you can also define custom text for the disabled button using the following syntax:

<input type="submit" value="Submit" tmt:waitmessage="Processing..." />

File extension
Upload a .pdf file, no white space or special chars inside its name (not required)
Upload a .jpg or .gif file, no white space or special chars inside its name (not required)
Upload a .jpg file, no white space or special chars inside its name (not required)
Upload a .zip file, no white space or special chars inside its name (not required)
Upload a file, no white space or special chars inside its name (not required)