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

New-ZipEntry Fails if File Being Added is > 2 GB #19

Closed
franklesniak opened this issue Nov 4, 2023 · 3 comments
Closed

New-ZipEntry Fails if File Being Added is > 2 GB #19

franklesniak opened this issue Nov 4, 2023 · 3 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@franklesniak
Copy link

franklesniak commented Nov 4, 2023

As the title says, New-ZipEntry fails with an error "Stream was too long." when adding a file larger than 2 GB to an existing archive.

Example command:

New-ZipEntry -Destination '.\Folder\ZipFile.zip' -EntryPath 'VeryLargeFile.csv' -SourcePath (Join-Path $env:temp 'VeryLargeFile.csv') -CompressionLevel ([System.IO.Compression.CompressionLevel]::SmallestSize)

Issue encountered on PowerShell version 7.3.8 on Windows 11.

@santisq
Copy link
Owner

santisq commented Nov 4, 2023

Hi @franklesniak thanks for submitting this issue, I think this might be the same issue discussed in #5 and if so, unfortunately I don't have a solution for this as its an issue with the .NET API being used behind the scenes.

@santisq santisq added the bug Something isn't working label Nov 4, 2023
@franklesniak
Copy link
Author

Oh, interesting. As a workaround, I must delete and recreate the ZIP file. Got it, makes sense!

@santisq
Copy link
Owner

santisq commented Nov 4, 2023

@franklesniak yeah, unfortunately it's the same issue as in #5 and it's been around since 2016: dotnet/runtime#1544... the best advise I could give you is to use 7zip if you need to add new Zip Entries to an existing Zip Archive or recreate the Zip Archive 😞

@santisq santisq self-assigned this Nov 6, 2023
@santisq santisq added the wontfix This will not be worked on label Jan 24, 2024
@santisq santisq closed this as completed Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants