Replies: 1 comment 4 replies
-
Actually, you could maybe integrate zip.js in a service worker as well. There is an example of service worker code here: https://github.com/gildas-lormeau/zip.js/blob/master/tests/all/test-sw-worker.js (and here https://github.com/gildas-lormeau/zip.js/blob/master/tests/all/test-sw.js for the launcher). |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am wondering if it is possible to prompt the user for a file name, start the download immediately, and then stream the chunks to the client, instead of waiting for all the blobs to be assembled? Our users can potentially zip up multiple GB's of files (each file can itself be GBs), and it would be nice UX if they could see the download progress instead of waiting for the zip to be assembled. I was able to achieve this type of behavior with an older library (no longer maintained) that used service workers, so not sure if that is a limitation that affects this?
Example code below. With this code, the user doesn't get prompted for a file name or download location until all the files have been downloaded to memory and the final blob assembled. With large files, they could be waiting for awhile with no indication that something is happening in the background.
Thanks for your help and any suggestions!
Beta Was this translation helpful? Give feedback.
All reactions