Pipe stream directly to filesystem when downloading file in browser

Viewed 78

I'm trying to download large file using chrome and would like to use stream to pipe it to the filesystem so it won't consume browser's RAM. Examples that I found so far, as I understand preloads everything to the RAM, and then save it to the filesystem, like:

const link = document.createElement('a');
link.href = window.URL.createObjectURL(new Blob([byte], { type: 'text/csv' }));
link.download = reportName;
link.click();

Also I can't use <a href=http://... /> because I need to pass authorization header with my request.

0 Answers
Related