Closed Tzvetelin88 closed 1 year ago
Actually I thing I just need to do:
writer.write(new Uint8Array(data.bufferData)).catch(() => {
.....
writer.abort;
});
and to emit signal to the backend to do abort() on the readableStream
If you do have control over the server then i do recommend to use server tech to save a file rather then relying on StreamSaver.js which is intended for huge data generated on the client side, such as a camera recording.
all streamsaver really dose is emulating how a server traditionally saves a file using a service worker to emulate what browser/server have traditionally done for years
Yes, I'm actually doing that on the server side. Using NodeJS fs to R/w files. I'm using StreamSaver.js on the client side, as downloading files is causing browser to crash. I did this implementation - https://github.com/Tzvetelin88/very-big-file-upload-download
StreamSaver works very well on the client side, which I was missing from long time and how to control big file download.
Is there a way to handle cancelation on the browser?
We start downloading a file, but at some point we click cancel on the browser and we get this:
where
are not handled properly on my end: