0

I want to check real MIME of a file which is to be upload.

How can I get HEX value and real MIME type of a uploaded file before uploading it so that no one can upload other than log files using javascript?

P N Jain
  • 302
  • 1
  • 13
  • What do you mean by "metaheader"? – Amadan Aug 23 '19 at 10:33
  • @Amadan I actually want to detect file's actual MIME type and want to verify that uploaded file is not malicious – P N Jain Aug 23 '19 at 10:58
  • For that, you would need a clientside antivirus software, which AFAIK doesn't exist, for good reason (it would be huge). The actual MIME type would be sniffed similarly, by comparing to patterns (though the usual MIME patterns are not as big). There is no "metaheader" that shows the "actual MIME type" or "maliciousness" of a file. These kinds of things are typically done serverside. – Amadan Aug 23 '19 at 11:07

0 Answers0