Possible Duplicate:
How to find the mime type of a file in python?
I want to detect the type of a file, but I don't want to look at the extension because it may be incorrect. The mimetypes module is filename based. 
Is there a standard way to peek inside the file?
 
     
     
    