How can I allow only certain file extensions for user file uploading?

Top  Previous  Next

Set allowed file extensions for uploaded user files in file_filter_fields.

Syntax:

allowed_files = ext

or

allowed_files = ext1|ext2|ext3

Example:

In your form:

<input type="file" name="attach">

Config file:

allowed_files = gif|bmp|png

file_filter_fields = attach (Picture)

Result:        

Only *.gif, *.bmp, *.png files would be allowed for user upload.