Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid zip file created from "append" (archiver@5.3.1) #628

Closed
unbornchikken opened this issue Nov 17, 2022 · 2 comments
Closed

Invalid zip file created from "append" (archiver@5.3.1) #628

unbornchikken opened this issue Nov 17, 2022 · 2 comments

Comments

@unbornchikken
Copy link

Append doesn't work entirely, doesn't matter what you include. It even doesn't work for strings. Minimal example:

cost archive = require('archiver')("zip")
archive.append("hello", { name: "test.txt" })
archive.finalize()
archive.pipe(require('fs').createWriteStream('example.zip'));

This produces a zip with CRC error.

I'm using Node 16 on Windows.

@unbornchikken unbornchikken changed the title Invalid zip file created from "append" Invalid zip file created from "append" (archiver@5.3.1) Nov 17, 2022
@crice88
Copy link

crice88 commented Dec 2, 2022

I'm also running into issues with Windows. Getting duplicate files in the zipped archive. On Mac, it works fine... not sure of the cause yet.

@ctalkington
Copy link
Member

it's likely order of operation issue, to get data flowing/streaming you need to pipe to file first before appending

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants