

Online
Manual / Configuration
Files / Limiting what
files can be uploaded.
Command:
allowedFileTypes
Usage:
Allows
you to limit what files are acceptable for the field you specify in
name.
Arguments:
- name="<field>"
Specify the name of the file field we are limiting.
- types="<wildcard
list>"
Specify the allowable mime-types. Allowing and denying certain file
uploads are checked by MIME type. Click here
for more information on MIME types.
- filenames="<wildcard
list>"
Specify the allowable file names.
- ignoreCaseFilenames
If specified the script will ignore the filenames case when doing a
match.
Example:
| allowedFileTypes
name="Image 1" types="image/*" filenames="*.jpg,*.gif"
ignoreCaseFilenames |
This example
allows us to limit the file upload field named 'Image 1' to only images
that have a .jpg or .gif extension. The file's extension case is ignored
so the user can upload images that have a .JPG or .GIF extension, etc.
| allowedFileTypes
name="textFile 1" types="text/plain" filenames="*.txt" |
This example
allows us to limit the file upload field named 'textFile 1' to only
plain text files that have a .txt extension. Since we did not specify
'ignoreCaseFilenames' in this example the file must have a .txt extension
and not .TXT, etc.
|