Just because it gracefully handles an error if the object you're creating is not actually an image() does not make it mime type validation, that would be handling onError... It could possibly be considered a form of passive image validation ... but really only for a handful of image types, and does not identify specific image types so I would not go as far as saying that it is a form of mime type validation (as you mentioned, it is 'limited'). And I didn't 'miss' the way it validates images, I saw that you were creating an image() object, and it's a very creative work-around to validate some image types on the client side. I just assumed that the user was looking for full mime type validation, and was only referencing what I thought would apply to what I figured he needed. What more do you want me to say? I've already said 3 times that it was a nice validation library (once referenced here), and have now said that the way you are validating images is a creative approach. Good job. Too bad about firefox... Seems like you have a good thing here otherwise.
Dissapointing (but expected) about browsers not following standard with the 'accept' attribute on input type="file". I've never personally tried to use it... Just saw that it was part of the standard and figured it might help. Let's just end this thread. I'm sure we've both got better things to do with our time than to argue. Jim Rising Sr. Cold Fusion Developer ICGLink Inc. www.icglink.com -----Original Message----- From: Massimo Foti [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 11, 2007 12:13 PM To: CF-Talk Subject: Re: Spry - File Upload - validate mime type > No need to get defensive. People tend to get defensive whenever you post ill-informed comments about their work. It's kind of human nature. > The original poster's request was for mime type validation, not for > finding > image dimemsions and such. That's why I wrote "If you need to validate images this could work" > I was speaking specifically about how TMT > validates file types. And you clearly haven't look at the code between line 463 and line 510. Or didn't realize that certain features can't be just the results of checking for file extensions. > I didn't even look at how TMT deals with file sizes, > dimensions, etc... The way that TMT validates file types is by regexp on > file extension: > > tmt_globalPatterns.filepath_pdf = new > RegExp("\\\\[\\w_]*\\.([pP][dD][fF])$"); > tmt_globalPatterns.filepath_jpg_gif = new > RegExp("\\\\[\\w_]*\\.([gG][iI][fF])|([jJ][pP][eE]?[gG])$"); > tmt_globalPatterns.filepath_jpg = new > RegExp("\\\\[\\w_]*\\.([jJ][pP][eE]?[gG])$"); > tmt_globalPatterns.filepath_zip = new > RegExp("\\\\[\\w_]*\\.([zZ][iI][pP])$"); > tmt_globalPatterns.filepath = new RegExp("\\\\[\\w_]*\\.\\w{3}$"); What you are missing is the way it validates images. It's just 10 lines above. It creates a JavaScript image object and if that fails it returns an error. Since browsers creates image objects only out of gif, jpg, png or bmp, this is can work as mime-type validation too. It has limitations > Again... It's a nice validation library... But it's not really doing what > the poster was asking for. There is no client-side solution for what the poster ask. As far as I know the "accept" attribute is unfortunately not supported by IE and FF (don't know about Safari, sorry). But I would be more than glad to be proved wrong on this. See also comments on "accept" here: http://htmlhelp.com/reference/html40/forms/input.html Anyway, my previous post was about your [...] it's really just using a regexp or pattern to define file extensions... [...] not about the original post (I already answered that one to my best). ---------------------------- Massimo Foti, web-programmer for hire Tools for ColdFusion and Dreamweaver developers: http://www.massimocorner.com ---------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| CF 8 â Scorpio beta now available, easily build great internet experiences â Try it now on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283495 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

