> 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
----------------------------




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283480
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to