libb.magic_mime_from_buffer
- magic_mime_from_buffer(buffer)[source]
Detect mimetype from a file’s bytes using the
magiclibrary.OOXML (docx/xlsx/pptx) and ODF documents that libmagic reports as the generic
application/zipare refined to their precise type by inspecting the archive – pass the whole file, not just a header, for that refinement to apply.