Is there some way to determine the MIME type of a file by it's content without using Magic Library in Python/Django?
I'm getting the content from a HTTP POST and I need to get the mime-type.
I cannot trust the content-type:
request.FILES[request.POST['fileToUpload']].content_type
It can be changed easily by changing the file extension.
document = request.FILES[request.POST['fileToUpload']].read()
I would need to get the content-type of the document:
THX