zip.js

How can I uncompress a gzip file in javascript?

ぃ、小莉子 提交于 2021-01-22 16:09:54
问题 I have gotten an ArrayBuffer data (called s as follows which consist of many blocks) from our serve side,the blob is generated as follows: var blob=new Blob([s.slice(4,82838)]); but the blob I have made is a gzip data;How can I uncompress it in javascript? I have tried zip.js but it didn't work?(and I still puzzled why it doesn't work). please tell me a method to un-compress the blob,thank you. (my English is poor,sorry) 回答1: In the browser I have used pako You may do something like.. var

通过javascript在网页端生成zip压缩包并下载

时光毁灭记忆、已成空白 提交于 2020-08-12 08:24:44
  zip.js是什么    zip.js 的github项目地址: http://gildas-lormeau.github.io/zip.js/   通过 zip.js 封装一个能在网页端生成zip文件的插件, 直接在网页中 创建包含文件夹 和 文件的压缩包 ,也可以 自定义名字 并下载;   如何使用:   1:引用zip.js   2:引用jQuery;   3:并引用封装的 ZipArchive.js ,(因为zip.js的api使用起来比较繁琐,所以自己封装实现了这个插件)   4:引用mime-types.js;    查看 DEMO , 使用方式为: <!DOCTYPE html> <html> <head lang= " en " > <meta charset= " UTF-8 " > <title></title> <script src= " http://gildas-lormeau.github.io/zip.js/demos/zip.js " ></script> <script src= " http://gildas-lormeau.github.io/zip.js/demos/mime-types.js " ></script> <script src= " http://apps.bdimg.com/libs/jquery/1.9.0