Closed Tzvetelin88 closed 2 years ago
I was reading the issues and found this one: https://github.com/jimmywarting/StreamSaver.js/issues/215 What I did is to use the approach and it worked.
const fileStream = streamSaver.createWriteStream('file_test.zip', {
size: this.selectedFile.size
});
const writer = fileStream.getWriter();
....
Receiving the chunks from backend as Buffer chunks:
writer.write(new Uint8Array(data.bufferData));
....
and it starts to write the file :)
Backend is reading fs.createReadStream(...) and sending chunks of a type Buffer to client side. Is it possible to write received chunks one by one to a file on a file system on a client side? I tried to do:
but didn't worked :(