Please use System.IO.Compression! A fork of the DotNetZip project without signing with a solution that compiles cleanly. This project aims to follow semver to avoid versioning conflicts. DotNetZip is a FAST, FREE class library and toolset for manipulating zip files. Use VB, C# or any .NET language to easily create, extract, or update zip files.
I am using the latest DotNetZip nuget package to create Zip files. However, for many of them (but not all), I get an error message when opening the Zip files in Windows. “Windows cannot open the folder.”
The Zip files can be opened via code. They can also be opened via 7zip. But not Windows.
I've tested with dozens of different files and file types and haven't found any specifics. But in these test PDFs, the "Public" one appears to be causing my issues. And I've validated it and it appears to be a good PDF. But it also happens with other files and file types.
When compared to a Zip file of the same source files created via Windows, the DotNetZip file is significantly larger. The source files are PDFs and I’ve validated them and they appear to be valid.
The Zip file passes the verification check. And DotNetZip can open it.
This is my code for creating the Zip. It's very basic. It's all in memory as I have a web app. But this code comes from my Unit Test project and it's basically the same.
` using (var ms = new System.IO.MemoryStream())
{
using (var archive = new Ionic.Zip.ZipFile())
{
foreach (var item in all)
{
archive.AddEntry(item.Name, item.Data);
}
I am using the latest DotNetZip nuget package to create Zip files. However, for many of them (but not all), I get an error message when opening the Zip files in Windows. “Windows cannot open the folder.”
The Zip files can be opened via code. They can also be opened via 7zip. But not Windows.
I've tested with dozens of different files and file types and haven't found any specifics. But in these test PDFs, the "Public" one appears to be causing my issues. And I've validated it and it appears to be a good PDF. But it also happens with other files and file types.
When compared to a Zip file of the same source files created via Windows, the DotNetZip file is significantly larger. The source files are PDFs and I’ve validated them and they appear to be valid.
The Zip file passes the verification check. And DotNetZip can open it.
This is my code for creating the Zip. It's very basic. It's all in memory as I have a web app. But this code comes from my Unit Test project and it's basically the same.
` using (var ms = new System.IO.MemoryStream()) { using (var archive = new Ionic.Zip.ZipFile()) { foreach (var item in all) { archive.AddEntry(item.Name, item.Data); }
`
Works - DotNetZip_PublicNotDeleted.zip Fails - DotNetZip.zip Fails - DotNetZip_PublicDeletedAndReAdded.zip Works - DotNetZip_DoubledNoPublic.zip Works - DotNetZip_NoPublic.zip Works - DotNetZip_Public.zip Works - DotNetZip_PublicDeleted.zip Works - DotNetZip_PublicDoubled.zip