Monday, February 25, 2008 10:02 AM
Aside from looking at the file extension, I don't think there is a way of determining this by just looking at the binary file.
An operating system relies on the file extension to launch the program that will interpret the image format and then render that image. Without that valid file extension, no operating system will upload and render an image. If you try to change the file extension, then the Operating system will usually send you a message telling you that if you do that, it will no longer be responsible for interpreting the image.
So.... rely on the file extension... if it is not there, throw an exception or don't let the person upload it.