title: Saving a Uint8Array to a binary file
body: <p>I am working on a web app that opens binary files and allows them to be edited.</p>
  
  <p>This process is basically <code>ondrop -&gt; dataTransfer.files[0] -&gt; FileReader -&gt; Uint8Array</code></p>
  
  <p>Essentially, I want to be able to save the modified file back as a binary file. Ideally as a file download with a specified file name.</p>
  
  <p>There doesn't seem to be any standard method of doing this, and that sucks, because everything up to that point is well supported.</p>
  
  <p>I am currently converting the array to a string using <code>String.fromCharCode()</code>, base64 encoding that, and using a data uri in a hyperlink like <code>data:application/octet-stream;base64,..</code>, along with the <code>download</code> attribute to specify filename.</p>
  
  <p>It seems to work, but it's quite hacky and I think converting the raw bytes to a string might introduce encoding issues depending on the byte values. I don't want the data to become corrupt or break the string.</p>
  
  <p>Barring that, is there a better/proper method for getting an array of bytes as a binary file to the user?</p>