title: Trouble changing a Uint8Array into a blob
body: <p>I'm writing something that takes a canvas (with 1 bit pixel colour depth), converts it into a Uint8Array (with one byte representing 8 pixels) then sends it out while receiving other similarly encoded messages.</p>
  
  <p>I figured blobs were a good fit for this sort of data, and I create a blob, create FormData, attach the blob to the FormData then send it like so:</p>
  
  <pre><code>function sendFormData(data){
      //data.data is a Uint8Array other attributes are strings
      var bytesBlob = new Blob([data.data],{type: "application/octet-stream"});
      console.log(bytesBlob,data.data);
      var form = new FormData();
      var request = new XMLHttpRequest();
      form.append("blob",bytesBlob,"message");
      form.append("user",data.user);
      form.append("colour",data.colour);
      form.append("room",currentRoom);
      request.open("POST","http://localhost:8080/",true);
      request.send(form);
  }
  </code></pre>
  
  <p>Now, using the console.log after the blob is created I'm able to see the length of the blob, which should be 2035 and is in Chrome, but on other webkit browsers (Safari) the size is 19.</p>
  
  <p>This is because, instead of making a blob out of the Uint8Array it's making a blob out of the words "[object Uint8Array]" which is obviously useful to no one.</p>
  
  <p>I see this when I download one of the blobs from the server:</p>
  
  <pre><code>$ cat blob-1 [object Uint8Array]
  </code></pre>
  
  <p>I guess this is the result of the Uint8Array object getting toString()'d at some point, so how do I ensure it's sent as actual binary data?</p>
  
  <p>I'm wondering if I'm even going about this correctly, using blobs or what would be the best method of sending the data?
  Especially because the target platform seems to raise an exception and halt instead of bloberising "[object Uint8Array]"</p>
  
  <p>The target platform is Webkit only so I don't have to worry about other types of browser.
  Thanks.</p>