Friend's Email Address. Your Name. Your Email Address. Send Email. LinkedIn 0 Tweet 0 Facebook 0 Email 0. Tags : JavaScript saveAs zip files. You may also like Web Components with React Hooks April 4, Notify of. As I mentioned above, the downloaded content is stored as Blob. The next step is to create a zip file using those Blob data. Huy Ngo. The first solution came into my mind is: Prepare the zip file on the server Upload it to a storage Give the client the URL to download it But this solution has a few drawbacks: The logic to generate a zip file is quite complicated.
I need to consider generating all files per request or combining between reusing existing files and generating new ones.
Both approaches seem complicated. They will take time to process and require a lot of effort coding, testing, and maintenance later on. It cannot utilize the feature I had already built. So, while the Zip file itself is not likely reusable, the single files do.
Generating a zip file takes a long time. Since my backend is a single-thread process, this operation can block other requests for a while and may get timed out during this time. I love to put a progress bar on the website. If everything is handled at the backend, I need to find an additional approach to report status to the frontend. And this is not easy.
I want to save costs for my infrastructure. Active 2 years, 2 months ago. Viewed 13k times. Improve this question. Rob Kwasowski Rob Kwasowski 2, 3 3 gold badges 8 8 silver badges 30 30 bronze badges. You should create a blob url instead of creating a base64 str, using URL. Add a comment. Active Oldest Votes. Improve this answer. I wonder if there's a way to download the zip without base64 encoding it.
By specifying the correct Blob type? Hope that helps! Dacre Denny Dacre Denny Thanks, but I want an actual.
Draghici C. Draghici 5 5 bronze badges. This is an amazing library!
0コメント