Home:ALL Converter>Is there a client side JavaScript mimetype library?

Is there a client side JavaScript mimetype library?

Ask Time:2011-08-07T08:25:13         Author:mjhm

Json Formatter

I'm looking for a client side JavaScript mimetype library similar to Python's mimetypes, or the 'mime' Node module.

I have two related use cases in mind. First is for validating the mimetype in an <input type="file"/> element. The second is for validating a bunch of filenames that come reading the file entries of a ZIP file via js-unzip and Cheeso's unzip utility.

Author:mjhm,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/6969900/is-there-a-client-side-javascript-mimetype-library
Paul Rumkin :

For the first target you can use list of mime types by extention convert in to JSON compress with gz and then use with your script. It's the most simplest way to do this crossbrowser.\n\nThe second you can use bash-comands in node, untar archive to tmp and then get mime types of the each file. Parse result with js and check if it compares with you validation list",