title: FileSaver creates a file with different content than the original
body: <p>I'm trying to use <code>Blob</code> to create a file from data passed across a server call, encoded in base64. The original file is an Excel spreadsheet 5,507 bytes long. The base64 encoding (with newlines) is 7,441 bytes. Using the command line base64 tool, I'm able to construct an exact copy of the original from the base64 version:</p>
  
  <pre><code>% base64 file.xlsx &gt; file.enc
  % base64 -d file.enc &gt; copy.xlsx
  % cmp file.xlsx copy.xlsx
  % file --mime-type copy.xlsx
  copy.xlsx: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  </code></pre>
  
  <p>In Typescript, I'm doing:</p>
  
  <pre><code>import * as dld from 'file-saver';
  
  const contentType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
  const data = atob(content)
  const contentBlob = new Blob([data], { type: contentType });
  
  dld.saveAs(contentBlob);
  </code></pre>
  
  <p>I've verified that the binary data (the variable <code>data</code> above) at least starts with the same bytes as the binary content of the original file. The file that it's creating is 7,729 bytes long, and has MIME type <code>application/zip</code> instead of the expected 5,507 bytes. What am I missing here? What do I do differently in order to create a client-side copy of the file?</p>