I want to send a large arraybuffer using ajax to make a string file into local folder in my computer.
When im trying to send request using chrome console:
> var arr = new Uint8Array(999999999);
> arr[0]=[84]; // this is TEST TEXT
> arr[1]=[69];
> arr[2]=[83];
> arr[3]=[84];
> arr[4]=[32];
> arr[5]=[84];
> arr[6]=[69];
> arr[7]=[88];
> arr[8]=[84];
function stringFromArray(data)
{
var count = data.length;
var str = "";
for(var index = 0; index < count; index += 1)
str += String.fromCharCode(data[index]);
return str;
}
$.ajax({
url: 'http://localhost:19885/binaryfile.bin' ,
cache: false,
async: false,
type: 'POST',
data: '{Type: "File", content: "'+ stringFromArray(arr)+'"}',
dataType: "json",
processData: false,
});
My browser crashed and i couldt create any file. Any help?