We are using HttpPostedFileBase to upload files to our asp.net mvc application. Is there some smart way of analyzing the contents of the file to determine the actual mime type by looking at the actual binary stream?

I want to make sure no .exe files or similar stuff are uploaded, just want to accept a number of files.

Something like a [preflight](http://en.wikipedia.org/wiki/Pre-flight_%28printing%29) on the file that is uploaded to extract information programmatically and determine the file type.