admin管理员组文章数量:1323035
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.
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.
Share Improve this question asked Oct 4, 2014 at 10:10 web_newbieweb_newbie 511 silver badge2 bronze badges 2- by download do you mean upload, as in the user drags and drops a bunch of files and then they get zipped on the fly in the browser? – Hayko Koryun Commented Oct 4, 2014 at 10:21
- No, my specific case is like this: I want to keep list of links to external resources on my server. Then the served should generate the webpage with js which will download those resources on the client side and zip them on the fly allowing to download dynamicaly created zip file on the client side. Is this somehow possible without using server bandwidth to download those resources but do it by browser? – web_newbie Commented Oct 4, 2014 at 10:26
2 Answers
Reset to default 3If 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
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 pression, it is also very performant.
Find "downzip" it on npm or github!
本文标签: javascriptDownload and zip files client sideStack Overflow
版权声明:本文标题:javascript - Download and zip files client side - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742108137a2421118.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论