Flex SDK 3.5 - Check file mimetype
Posted
by Fernando
on Stack Overflow
See other posts from Stack Overflow
or by Fernando
Published on 2010-04-19T17:16:49Z
Indexed on
2010/04/20
20:13 UTC
Read the original article
Hit count: 247
Is there a way to get a file's mimetype in Flex SDK 3.5 without using its extension?
I need to validate if an uploaded file is of a certain kind. This is for images, or documents (PDF, ODT, etc.)
All the solutions I've found are by checking its extension. What if I rename a .odt file as a .jpg? Then I can upload it as an image...
I should add, we are using an AIR desktop client and a Java EE server. File checking is solved on the Java side, but the idea is not to go to the server, validate the file so if it's not valid, there's no network traffic at all.
© Stack Overflow or respective owner