title: Get file MIME type in Javascript
body: <p>I know when uploading a file I can use <code>file.type</code> to get the MIME, but in Javascript itself am I able to get a MIME type just from an extensio?</p>
  
  <p>e.g.</p>
  
  <pre><code>&lt;script&gt;
  var file = "myfile.jpg";
  alert(**FILE'S MIME**);
  &lt;/script&gt;
  </code></pre>