I'm making a simple file uploader with end to end encryption. I have the uploading/encryption down but I am not sure how to save larger files without causing a memory overload. Let's say for example I have a 2gb file, I'll decrypt it in chunks of, say, 1kb. But once I have all these chunks (either as buffers or blobs) how can I save them locally as a stream? I found this
var json = JSON.stringify(data),
blob = new Blob([json], {type: "octet/stream"}),
url = window.URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);
but with big files I think that would just cause the browser to crash.
Edit: I found this which says the memory limit for blobs if 500MiB, which is definitely too low. Do I have any options here?