In case of the file size is under 5000 bytes (InMemoryUploadedFile). This code doesn't work
mime_type = magic.from_buffer(file.read(), mime=True)
It returns wrong mime_type. For example, I have a file cv.docx with 4074 bytes size. It returns a mime_type:
'application/x-empty'
instead of
'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
Could you please suggest me any advices to solve this case?