title: Using FileReader() to read bytes in older browsers with support issues
body: <p>If one searches <code>File</code> on <a href="https://caniuse.com/#search=File" rel="nofollow noreferrer">caniuse.com</a> and expands <code>show all</code>, it's evident that older browsers (e.g. Android) have the following issues:</p>
  <blockquote>
  <p>Does not have FileReader support.</p>
  <p>Does not support the File constructor.</p>
  </blockquote>
  <p>I want to understand what the first statement means in practice.</p>
  <p>For instance, I'm receiving a file via an HTML input element like so:</p>
  <pre><code>var img_file = e.target.files[0];
  </code></pre>
  <p>Note that <code>img_file</code> is an object of type <code>File</code>.</p>
  <p>Next, I'm reading the first few bytes of the file using a <code>FileReader()</code> object, and then determining the mime type:</p>
  <pre><code>  var reader = new FileReader();
    reader.onload = validate_file;//validates the file's mime type
    reader.readAsArrayBuffer(img_file.slice(0,4));
  </code></pre>
  <p>Does &quot;<strong>Does not have FileReader support</strong>&quot; imply that the statements above will give an error? If so, are there any workarounds for unsupportive browsers? I'd love to see an illustrative example around such workarounds (if they exist).</p>
  <p><em>Note: Please use pure JS for the scope of this question, and sans any 3rd party libraries.</em></p>