Closed Yassin-Samir closed 1 year ago
If you are generating a zip Blob
into memory then you might as well just use a link to download the file.
...As the hole point of StreamSaver is to write chunks one chunk after the other directly to the hard drive without accumulating any RAM usage.
const blob = await zipper.generateAsync({ type: "blob" })
const link = document.createElement('a')
const url = URL.createObjectURL(blob)
link.href = url
link.download = 'package332.zip'
link.click()
URL.revokeObjectURL(url)
i can't cause this zip file file gets its files from s3 bucket aws so i wrap all these files into the zip
yes. And when you do wrap all your s3 files into a zip file then you do get a Blob
back from running
await zipper.generateAsync({ type: "blob" })
...then you already got a complete final Blob
that you can use to save the file using traditional a[download][href=bloburll]
tech.
if you need to save smaller blobs then it's easier to just save them using traditional download links or using FileSaver.js
i assume zipper.generateAsync
comes from jszip?
yeah thanks
here is my code