title: Select files on Android web with input type=file: excel files incorrectly available to select, and return PDF mime type
body: <p>I want to limit file uploads on my mobile web app to image and PDF file types. However, when I open the file picker in Chrome on Android, I can select excel files, which should not be available to select based on what I've specified in the <a href="https://www.wufoo.com/html5/accept-type-attribute/" rel="nofollow noreferrer">accept attribute of the input element</a>. The problem seems to be specific to Android- excel files are grayed out in iOS and are hidden on desktop. </p>
  
  <p>Furthermore, if I navigate to Google Drive through the file picker and select an excel file, the returned mime type of the file is <code>application/pdf</code>. Here, I would expect  <code>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</code> or <code>application/vnd.google-apps.spreadsheet</code> as the mime type. This only happens for excel files from Google Drive i.e. selecting an excel file from Downloads returns the expected mime type.</p>
  
  <p>Therefore, I have two questions:
  <br>
  <strong>1. Is it expected behavior for Android to not adhere to file types specified in the accept attribute?</strong>
  <br>
  <strong>2. Why are excel files selected from Google Drive returned with PDF mime type?</strong></p>
  
  <p>Input element that accepts image and PDF files:</p>
  
  <pre><code>&lt;input onchange="showImage('Files')" type="file" name="Files" accept="image/*,.pdf" value="Upload a file""&gt;
  </code></pre>
  
  <p>Function that triggers after I select the <a href="https://i.stack.imgur.com/jjJJl.png" rel="nofollow noreferrer">excel file</a>:</p>
  
  <pre><code>function showImage(type){
    var file = document.querySelector(`input[name=${type}]`).files[0];
    console.log(file);
  }
  </code></pre>
  
  <p>And the log of the selected file: </p>
  
  <p><code>File(47847) {name: "Gratefulness.pdf", lastModified: 1536163728724, lastModifiedDate: Wed Sep 05 2018 11:08:49 GMT-0500 (hora de verano central), webkitRelativePath: "", size: 47847, …}
  lastModified: 1536163745655
  lastModifiedDate: Wed Sep 05 2018 11:09:06 GMT-0500 (hora de verano central) {}
  name: "Gratefulness.pdf"
  size: 47847
  type: "application/pdf"
  webkitRelativePath: ""
  __proto__: File</code></p>