web_newbie
web_newbie

Reputation: 51

Download and zip files client side

I'm quite JS newbie and I'm wondering about some idea.

Can javascript be used to download file/multiple files from given url/s on the client side and zip "the stream" on the fly?

I don't want this server side, because I don't want to download files to my server and zip then.

Upvotes: 5

Views: 8873

Answers (2)

Hayko Koryun
Hayko Koryun

Reputation: 1244

If the following use case is correct: user selects a bunch of files to zip and the browser zips them up and serves them back to the user.

Then you can use the following library: zip.js

You can check out the demo here

Upvotes: 3

DebboR
DebboR

Reputation: 331

To solve this exact problem, I created a library to stream multiple files directly into a zip on the client-side. The main unique feature is that it has no size limits from memory (everything is streamed) nor zip format (it uses zip64 if the contents are more than 4GB).

Since it doesn't do compression, it is also very performant.

Find "downzip" it on npm or github!

Upvotes: 2

Related Questions