I have a javascript snippet written which checks for the mime type of the files.
var type = this.files[0].type;
Code was running fine for a long time but now somehow its not able to find value of file type.
I checked in browser's debug tool and find mime type of file is blank.
Issues is happening on some machines only and running fine on others, although both machines are running on Windows 10 and using same version of google chrome (version 68.0.3440.84).
Any idea?
A media type (also known as a MIME type) is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication of these classifications.
There are too many issues with MIME types on different operating systems, different applications saving files differently, some files not having a MIME at all, and lastly, the fact that the extension and MIME could be altered by a malicious user or program.
Finally, i got the answer for my question and here is reason why this was happening on some machines.
As i was expecting, issue is system specific where content-type for .csv type is missing under Registry (HKEY_CLASSES_ROOT.csv).
See screenshot, This entry was missing on some machines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With