Finalize() not working for multiple files in zip
See original GitHub issue var archive = archiver('zip');
archive.on('error', (err) => {
console.log(err);
throw err
})
for (const report of generatedReports) {
//report is excel work book object
const buffer = await report.writeToBuffer()
archive.append(buffer, {
name: name
})
}
console.log("before finalize")
await archive.finalize()
console.log("after finalize")
I am appending multiple excel buffers to the archive, if the number of files I am appending is small ~ 15, it will finalize. But if I append ~20 files, it reaches “before finalize” but never reaches “after finalize”
I am not sure what I am doing wrong, I have tried with zip options {store: true}, it’s able to zip more files but still silently fails.
Help!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:5
Top Results From Across the Web
Developers - Finalize() not working for multiple files in zip -
Coming soon: A brand new website interface for an even better experience!
Read more >how to convert multiple files to compressed zip file using node js
I'm confused by archiver readme which 1) places archive.pipe(output) before appending files and archive.finalize() (shouldn't it be afterwards?), 2) calls ...
Read more >Java 2 Platform SE v1.3.1: Class ZipFile - The Java Version Almanac
Returns an enumeration of the ZIP file entries. protected void, finalize() Ensures that the close method of this ZIP file is called when...
Read more >ZipFile (Java Platform SE 7 ) - Oracle Help Center
Method Summary ; protected void, finalize(). Ensures that the system resources held by this ZipFile object are released when there are no more...
Read more >Golang Zip File Example
Close zip archive using zip.Writer.Close ... Once all the files and directories have been written to the archive, you can close the zip...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I ran into the same problem when calling
archive.pipe(...)afterawait archive.finalize(). Callingarchive.pipe(...)as early as possible solved the issue for me.Seems to be an easy mistake to make.
@Qirsia is that the whole code for the archiver? You need to store or pipe the archive somewhere before finilizing.