I'm using pizzip.js and made a new instance of the pizzip then passed in the file result and then used docxtemplatr package my code:
var zip = new PizZip(reader.result);
var doc = new window.docxtemplater().loadZip(zip);
var text = doc.getFullText();
console.log(text);
The error:
zipEntries.js:270 Uncaught Error: Corrupted zip: missing 589 bytes.
at ZipEntries.readEndOfCentral (zipEntries.js:270)
at ZipEntries.load (zipEntries.js:296)
at new ZipEntries (zipEntries.js:32)
at PizZip.module.exports [as load] (load.js:25)
at new PizZip (index.js:41)
at FileReader.reader.onload (en:393)
Any solution?
It works for me when I read the file using
binary
as encoding: