title: How do I get a html5 file input to accept only certain file types consistently across browsers?
body: <p>According to <a href="https://stackoverflow.com/a/11834872">this answer on Stack Overflow</a>, we can set the <code>accept</code> attribute of an <code>&lt;input type="file" /&gt;</code> to filter accepted input, as follows:</p>
  
  <pre><code>accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
  </code></pre>
  
  <p>However, as you can notice running the simple snippet below, <strong>Chrome 43.0.something</strong> appears to <strong>simply disregard</strong> this configuration, while it is perfectly understood by <strong>Firefox 39.0</strong>.</p>
  
  <p>I considered switching to a more blunt approach, using:</p>
  
  <pre><code>accept=".xls, .xlsx"
  </code></pre>
  
  <p>... which works fine in <em>Chrome</em> but makes <em>Firefox</em> somewhat confused, accepting only the files using the <code>.xlsx</code> extension.</p>
  
  <hr>
  
  <p>Considering that this is probably very common and basic, I must be missing something: where am I screwing up? <strong>How do I get a html5 file input to suggest only <code>.xls</code> and <code>.xlsx</code> files consistently across browsers?</strong></p>
  
  <p>Here's a code snippet illustrating my issue (along with a <a href="http://jsfiddle.net/qzw5xr6t/2/" rel="noreferrer">JSFiddle link</a> in case you'd wanna fiddle with it).
  <div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Accepts application/vnd.ms-excel and the likes:&lt;br /&gt;
  &lt;label for="file1"&gt;File input&lt;/label&gt;
  &lt;input type="file" name="file1" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"/&gt;
  &lt;hr /&gt;
  Accepts .xls and .xlsx:&lt;br /&gt;
  &lt;label for="file2"&gt;File input&lt;/label&gt;
  &lt;input type="file" name="file2" accept=".xls, .xlsx"/&gt;</code></pre>
  </div>
  </div>
  </p>