Open ChukkapalliSukhesh opened 5 years ago
try below @ChukkapalliSukhesh
// create file
import * as Minizip from 'minizip-asm.js'
import * as fs from 'fs'
var text = Buffer.from("content");
var mz = new Minizip();
mz.append("test.txt", text, {password: "psd"});
fs.writeFileSync("test.zip", Buffer.from(mz.zip()));
// extract file
import * as Minizip from 'minizip-asm.js'
import * as fs from 'fs'
var mz = new Minizip(Buffer.from(fs.readFileSync('test.zip')));
var textBuffer = mz.extract('test.txt', { password: "psd"})
console.log(textBuffer.toString()); // "content"
Created Zip file using append. But unable to extract the zip file. It given 'Blank file' error.