I'm trying to validate mime types of files uploaded with a predefined
list of validate mime types.
I need to do the check the file in the
buffer before save, even if they are faked or no extensions.
1. python own mimetypes package seems to "guess" only base on extension
2. magic-python looks ok, but has OS dependencies because is using UNIX libmagic.
I had a lot of trouble with it on Windows 64 bit, and even after I fixed the dependencies error other issue appears and it couldn't identify files.
This also is a issue because is hard to install OS related filed on a predefined hosting.
3. I found filetype package but it only checks "magic numbers" for a limited file types, and docx and other identifies them as zip file(wich are archive as technology),
but I need to identify them as what they really are.
What other non OS dependent solutions that can check if the file is faked or with no extension exist ? (pdf,doc,docs,csv,xls,
xlsx, ods,odt,odm)
I'm trying to validate mime types of files uploaded with a predefined list of validate mime types.
I need to do the check the file in the buffer before save, even if they are faked or no extensions.
What other non OS dependent solutions that can check if the file is faked or with no extension exist ? (pdf,doc,docs,csv,xls,
xlsx, ods,odt,odm)