Determine the file format in Python if you are not sure what the actual content of the file is, or to check the format compatibility.... If you attempt to load a file into a Document object...determine the file format without loading a document with possible exceptions...