User Guide
322 Chapter 17 Managing Files on the Server
Note
Not all browsers support MIME type associations.
Example: Restricting file types
This cffile specification saves an image file only if it is in the GIF format:
<cffile action="Upload"
fileField="Form.FiletoUpload"
destination="c:\uploads\MyImage.GIF"
nameConflict="Overwrite"
accept="image/gif">
This cffile specification saves an image file only if it is in GIF or JPEG format:
<cffile action="Upload"
fileField="Form.FiletoUpload"
destination="c:\uploads\MyImage.GIF"
nameConflict="Overwrite"
accept="image/gif, image/jpeg">
This cffile specification saves any image file, regardless of the format:
<cffile action="Upload"
fileField="Form.FiletoUpload"
destination="c:\uploads\MyImage.GIF"
nameConflict="Overwrite"
accept="image/*">
Note
ColdFusion saves any uploaded file if you omit the accept attribute, leave it empty,
or specify "*/*".