View Full Version : Mime types

SeeIT Solutions
04-07-2008, 02:48 AM

I was wondering if it is possible to check a file mime type before uploading using the filereference class. I deal with idiotic clients that think it's ok to rename files from .gif to .jpg when it tells then they can only upload .jpg files.

Is it possible to check what type a file really is as the fileref.type function only returns the extension.


04-07-2008, 05:07 AM
I think you'll need to use an external script to do that. Not positive on that though.

SeeIT Solutions
04-07-2008, 05:44 AM
Yeah, I was hoping I could do instant feedback so they don't go ahead uploading 5MB images only to find out they've done something dumb.

04-13-2008, 04:14 PM
you can use php's mime_content_type() function. it is server side so it requires ur file to be uploaded 1st. i dont think there is a way in actionscript.