code: function mimeTypeFromFilename( filename ) {
  	var ext = filename.split(".").pop().toLowerCase();
  	return mime.lookup(filename) || "application/octet-stream";
  }
docs: Pick MIME type according to filename and known MIME Types