title: Migrate FileReader ReadAsBinaryString() to ReadAsArrayBuffer() or ReadAsText()
body: <p>I realize that the new Mozilla Firefox return <code>allocation size overflow</code> (on FileReader.ReadAsBinaryString()) when the file bigger than 200MB (something like that).</p>
  
  <p>Here's some of my code on test for client web browser:</p>
  
  <pre><code>function upload(fileInputId, fileIndex)
  {
      var file = document.getElementById(fileInputId).files[fileIndex];
      var blob;
      var reader = new FileReader();
      reader.readAsBinaryString(file); 
      reader.onloadend  = function(evt)
      {
          xhr = new XMLHttpRequest();
  
          xhr.open("POST", "upload.php", true);
  
          XMLHttpRequest.prototype.mySendAsBinary = function(text){
              var data = new ArrayBuffer(text.length);
              var ui8a = new Uint8Array(data, 0);
              for (var i = 0; i &lt; text.length; i++){ 
                  ui8a[i] = (text.charCodeAt(i) &amp; 0xff);
              }
  
              if(typeof window.Blob == "function")
              {
                   blob = new Blob([data]);
              }else{
                   var bb = new (window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder)();
                   bb.append(data);
                   blob = bb.getBlob();
              }
  
              this.send(blob);
          }
  
          var eventSource = xhr.upload || xhr;
          eventSource.addEventListener("progress", function(e) {
              var position = e.position || e.loaded;
              var total = e.totalSize || e.total;
              var percentage = Math.round((position/total)*100);
          });
  
          xhr.onreadystatechange = function()
          {
              if(xhr.readyState == 4)
              {
                  if(xhr.status == 200)
                  {
                      console.log("Done");
                  }else{
                      console.log("Fail");
                  }
              }
          };
          xhr.mySendAsBinary(evt.target.result);
      };
  }
  </code></pre>
  
  <p>So I tried change it to FileReader.ReadAsArrayBuffer(), the error has not shown up but the data are not the same (as it's not read as binary string).</p>
  
  <p>Did anyone has any solution to solve this problem? Is there any way that we can upload bigger file from JS to Web Server in raw/string other than FileReader implementation?</p>
  
  <p>I read on Mozilla JS Documentation that said:</p>
  
  <blockquote>
    <p>This feature is non-standard and is not on a standards track. Do not
    use it on production sites facing the Web: it will not work for every
    user. There may also be large incompatibilities between
    implementations and the behavior may change in the future. - <a href="https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsBinaryString" rel="nofollow noreferrer">Mozilla</a></p>
  </blockquote>
  
  <p>If not ReadAsBinaryString, the how to implement ReadAsArrayBuffer or ReadAsText</p>