When reading your question, the File Dropper widget could help you out. In addition to the great UX, you will get the option to validate your files before or after the upload. This also includes filtering based on mime type.
If you want to restrict certain types statically, you can also set this in the Mendix File Manager widget itself (extensions).
Is this what you're looking for? If you want to see if, for example, a .jpeg file is really an image, I'm afraid I can't help you out.
There is a GetFileType java action in the latest ApprontoCommon module that may help you out. It uses the Apache Tika library.