Blob does support ArrayBuffer as a constructor argument, but when used on download(), it returns just a same-lengthed stream of zeroes it does everything right.
UPD: Don't forget to use views to fill ArrayBuffers, like this:
var str= "hello world", arr= new ArrayBuffer(str.length); arr2=new Int8Array(arr);
str.split("").forEach(function(a,b){
arr2[b]=a.charCodeAt();
});
download( arr, "textArrayBuffer.txt", "text/plain" );
Blob does support ArrayBuffer as a constructor argument, but when used on
download()
,it returns just a same-lengthed stream of zeroesit does everything right.UPD: Don't forget to use views to fill ArrayBuffers, like this:
I'm closing the issue.