I have an issue with cffile on OS MAC using IE.
If the file field is left blank it passes a .tmp file in the form fields and this makes the cffile tag blow up because I'm limiting acceptable file type to jpg or gif.
My code works fine in all other OS and browsers.
<CFIF Trim(uploadfile) IS NOT "">
<!--- upload the new file --->
<cffile action="UPLOAD"
filefield="uploadfile"
destination="#request.imageroot#"
nameconflict="MAKEUNIQUE"
accept="image/jpeg, image/jpg, image/gif, image/pjpeg">
<CFSET article_image = '#File.ServerFile#'>
<CFELSE>
<CFSET article_image = 0>
</CFIF>
Is there a way to check for file type before the cffile tag?
Any input is appreciated.
If the file field is left blank it passes a .tmp file in the form fields and this makes the cffile tag blow up because I'm limiting acceptable file type to jpg or gif.
My code works fine in all other OS and browsers.
<CFIF Trim(uploadfile) IS NOT "">
<!--- upload the new file --->
<cffile action="UPLOAD"
filefield="uploadfile"
destination="#request.imageroot#"
nameconflict="MAKEUNIQUE"
accept="image/jpeg, image/jpg, image/gif, image/pjpeg">
<CFSET article_image = '#File.ServerFile#'>
<CFELSE>
<CFSET article_image = 0>
</CFIF>
Is there a way to check for file type before the cffile tag?
Any input is appreciated.