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.
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",