I found a great article that uses the cffile tag and checks the mime type on the server side but shows the error in a formatable way instead of the CFfile tag error message.
http://tutorial260.easycfm.com/ >This is nice, but it's really just using a regexp or pattern to define file >extensions... Not detecting mime type within the browser client on upload. >People could just rename the file extension of the file that they are >uploading, and the validator would fail. I'm pretty sure that javascript >won't return mime types to you. The only way that I know to validate mime >types on a file upload is on the server side, and by then... The file is >already uploaded. You can, however use the 'accept=' attribute of the input >type="file" ... And refuse to allow upload of a comma delimited list of mime >types: > ><input type="file" name="myFile" accept="text/html,image/jpeg,audio/mpeg"> > >I'm pretty sure that this occurs in the browser prior to upload. > >Jim Rising >Sr. Cold Fusion Developer >ICGLink Inc. >www.icglink.com > > >-----Original Message----- >From: Massimo Foti [mailto:[EMAIL PROTECTED] >Sent: Wednesday, July 11, 2007 9:42 AM >To: CF-Talk >Subject: Re: Spry - File Upload - validate mime type > >> Any one of a way to validate the mime type of a file before it's >> uploaded using Ajax or Spry? > >If you need to validate images this could work (fails silently on FF, see >the notes): >http://www.massimocorner.com/validator/samples/image_upload.htm > >---------------------------- >Massimo Foti, web-programmer for hire >Tools for ColdFusion and Dreamweaver developers: >http://www.massimocorner.com >---------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283457 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

