Question
upload mime type errors
I am uploading images and using the accept attribute in the
cffile tag and all works fine except when a user tries to upload an
unaccepted file type.
Here is what I have:
<cfif structkeyexists(form,"imagefile")>
<cffile action="UPLOAD" filefield="imagefile" destination="#ExpandPath("uploads")#" nameconflict="MAKEUNIQUE" accept="image/jpg, image/jpeg, image/pjpeg, image/gif, image/tiff" >
</cfif>
How or what is the best way to handle a situation when an unacceptable format is attempted to be uploaded? Mainly the CF error that ensues is what I want to fix. The users would have no idea what that error message means.
Here is what I have:
<cfif structkeyexists(form,"imagefile")>
<cffile action="UPLOAD" filefield="imagefile" destination="#ExpandPath("uploads")#" nameconflict="MAKEUNIQUE" accept="image/jpg, image/jpeg, image/pjpeg, image/gif, image/tiff" >
</cfif>
How or what is the best way to handle a situation when an unacceptable format is attempted to be uploaded? Mainly the CF error that ensues is what I want to fix. The users would have no idea what that error message means.
