Say I let users upload files to my server, and I let users download them. I'd like to set the mime type to something other than just application/octet-stream, so that if the browser can just open them, it does (say, for images, pdf files, plain text files, etc.) Of course, since the files are uploaded by users, I can't trust the file extension, etc.
Is there a good library for figuring out what mime type goes with an arbitrary blob? Preferably usable from Python :-)
Thanks!