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

Second time zipping files with password fails #101

Open
marcobullin opened this issue Jul 12, 2024 · 0 comments
Open

Second time zipping files with password fails #101

marcobullin opened this issue Jul 12, 2024 · 0 comments

Comments

@marcobullin
Copy link

Your sample code with password protection works only once.
The second time I call my function with the exact same code you provide it fails with the following error message:

"register(zip-encryptable): format already registered"

Here is my code changes but still fails:

const zip = () => {
// ...

if (!s3Zip.format || !s3Zip.registerFormat) {
  s3Zip.setRegisterFormatOptions("zip-encryptable", zipEncryptable).setFormat("zip-encryptable");
}

  const archive = s3Zip
    .setArchiverOptions({ zlib: { level: 8 }, encryptionMethod: "aes256", password: '123' })
    .archive(
      { region: "MY_REGION", bucket: "MY_BUCKET" },
      "MY_FOLDER",
      [fileA, fileB,...]
    );

// ...
}
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

1 participant