title: how to use xhr.overrideMimeType in Chrome / IE Edge?
body: <p>I have an issue with sending a file (part of a request in form data format).</p>
  
  <p>The issue seems coming from the fact that <strong>only</strong> in <strong>Chrome</strong> for <strong>Linux</strong> the file (which is CVS file, with .csv extension and basically just text) is sent with mimetype  (Content-type in request body) <strong>Content-Type: application/octet-stream</strong></p>
  
  <p>So, I am trying to <strong>override</strong> the mimetype to match the same sent by <strong>Chrome</strong> on <strong>Linux</strong> which is <strong>text/csv</strong>.</p>
  
  <p>However the mimetype is apparently <strong>not</strong> overriden and still send as <strong>octet-stream</strong>.</p>
  
  <p>My code:</p>
  
  <pre><code>let xhr = new XMLHttpRequest();
  let form = new FormData();
  
  form.append('file', file, file.name); // the file is loaded correctly
  form.append('payload', JSON.stringify(data)); // data is just a JSON object
  
  xhr.onreadystatechange = function() { 
       if (xhr.readyState === XMLHttpRequest.DONE) {
           // we arrive here both on Debian and Windows 10
       }
  } 
  xhr.upload.onerror = function() { .... } // no error
  
  xhr.open('POST', 'http://&lt;my_url&gt;', true);
  
  console.log(file.type);
  xhr.overrideMimeType("text/csv");
  
  xhr.send(form);
  </code></pre>
  
  <p>A couple of notes:</p>
  
  <ul>
  <li>console.log(file.type) actually <strong>prints</strong> "text-csv" but only in <strong>Chrome for Linux (Debian specifically)</strong>. in the other cases (any other browser or platform) <strong>nothing</strong> is printed</li>
  <li>given the previous point, it seems clear to me for some reason any other browser / platform <strong>can't recognize the file type</strong>, so the file is sent as <strong>octet-stream</strong> (general binary file)</li>
  </ul>