Example
// loading a zip file
JSZipUtils.getBinaryContent("path/to/file.zip", function (err, data) {
if(err) {
throw err; // or handle the error
}
var zip = new JSZip(data);
});
// loading a file and add it in a zip file
JSZipUtils.getBinaryContent("path/to/picture.png", function (err, data) {
if(err) {
throw err; // or handle the error
}
var zip = new JSZip();
zip.file("picture.png", data, {binary:true});
});
No comments:
Post a Comment