admin管理员组文章数量:1323738
I found a javascript plugin that could generate zip files, its called jszip.
I tried it, but I think it could only generate the files that will be piled in a zip file.
What I want is to be able to add existing files to the zip file that it will generate. Is it possible in JavaScript?
I found a javascript plugin that could generate zip files, its called jszip.
I tried it, but I think it could only generate the files that will be piled in a zip file.
What I want is to be able to add existing files to the zip file that it will generate. Is it possible in JavaScript?
Share Improve this question edited Aug 3, 2019 at 1:08 Emma 27.8k11 gold badges48 silver badges71 bronze badges asked Nov 2, 2011 at 4:52 user225269user225269 10.9k70 gold badges178 silver badges254 bronze badges 01 Answer
Reset to default 6Scroll down to the Documentation section on the page you linked to. It describes plainly how to add files to the zip file. For binary files you'll end up using base64, it looks like. For text files you can pass them straight in as strings. Of course you'll need access to the file data in order to add it to the zip file, which is easy enough if you're, say, retrieving said data in an Ajax request, but an uphill battle if you want the user to be able to zip files from his or her local storage.
本文标签: How to create zip files using javascriptStack Overflow
版权声明:本文标题:How to create zip files using javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742119905a2421647.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论