guess-file-type

Detect the file type by doing various checks. Returns the mime type.