automatic mimetypes in javascript node.js

Mark picture Mark · Mar 15, 2011 · Viewed 15.4k times · Source

I'm uploading files to aws s3 in javascript, and AFAIK they all need a mimetype to function correctly. Is there a script that automatically maps filenames to mimetypes that I could use?

Edit: If there's a way for amazon to automatically handle the mimetypes that would be better.

Answer

Zikes picture Zikes · Mar 15, 2011

https://github.com/broofa/node-mime is a decent looking library for automatic mime lookups.