Is it possible to determine the type of a file-like object in Python?
For instance, if I were to read the contents of a file into a StringIO container and store it in a database, could I later work-out the original file-/content-/mime-type from the data? Eg. are there any common headers I could search for? 
If not, are there any ways to determine "common" files (images, office docs, etc)?
Yes, you should evaluate the hex signature.
Determine file-/content-/mime-type from file-like?