-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Problem writing a large file to ZipArchive #101238
Comments
What error? |
Updated issue. |
Thanks!
edit: it's #1544 once again |
Tagging subscribers to this area: @dotnet/area-system-io-compression |
Before posting the error here, I researched other similar problems and, of course, used Google. |
edit: nvm. this is #1544 |
Could you please provide working code? |
So, this seems to essentially be blocked by #1544. IF you can rebuild the existing archive, you can avoid the in-memory using (FileStream zipToOpen = new FileStream("release.zip", FileMode.OpenOrCreate, FileAccess.Write))
{
using (ZipArchive archive = new ZipArchive(zipToOpen, ZipArchiveMode.Create))
{
ZipArchiveEntry readmeEntry = archive.CreateEntry("Readme.txt");
using (StreamWriter writer = new StreamWriter(readmeEntry.Open()))
{
for (int i = 0; i < 250000000; i++)
{
writer.WriteLine("Information about this package.");
writer.WriteLine("========================");
}
}
}
} |
Duplicate of #1544 |
Description
The problem occurs when writing a large file to an archive.
Reproduction Steps
Expected behavior
The code will run without errors
Actual behavior
The code worked with an error
System.IO.IOException: 'Stream was too long.'
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: