You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letzip=newJSZip();zip.file("Hello.txt","Hello World\n");letimg=zip.folder("images");img.file("smile.gif",imgData,{base64: true});zip.generateAsync({type: "blob"}).then(function(content){// see FileSaver.jssaveAs(content,"example.zip");});
解压文件
fetch("test.zip").then(response=>response.arrayBuffer()).then(JSZip.loadAsync).then(zip=>{// use file index for filezip.file("test.json").async("uint8array").then(u=>console.log(u));});
JSZip是一个JavaScript库 可以很方便的用来读写.zip文件同时可以用在服务器端
压缩文件
解压文件
相关开源库
JSZip
FileSaver
The text was updated successfully, but these errors were encountered: