Somewhat late, but why donโt you capture and save the MIME type when downloading the file? <cffile> returns it in cffile.contentType and cffile.contentSubType , so it is not absolutely burdensome. Of course, you will need to run the scan on existing files, but this is just a one-line script.
FWIW, my file upload code also sends the file size and the modified date and checks for repeated requests for unmodified files. All this after authentication / authorization, of course:
<cfset modified=parsedatetime(queryname.datestamp)/> <cfif structkeyexists(cgi, "http_if_modified_since")> <cfif parsedatetime(cgi.http_if_modified_since) gt modified> <cfheader statuscode=304 statustext="Not modified"/> <cfabort/> </cfif> </cfif> <cfheader name="Content-Disposition" value='disposition=#disposition#; filename="#queryname.filename#"'/> <cfheader name="Content-Length" value=#queryname.size#/> <cfheader name="Last-Modified" value=#gethttptimestring(modified)#/> <cfcontent type=#queryname.mimetype# file="application.pathToDataDirectory/#queryname.filename#"/>
Pete jordan
source share