haf / DotNetZip.Semverd

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.
Other
545 stars 218 forks source link

After Extracting (with password), the file is saved inside nested folders. Using Overloaded function for AddFile doesn't apply the password. #261

Closed amishraAFS closed 1 year ago

amishraAFS commented 2 years ago

I'm using the overloaded function to explicitly specify the directory. This resolves the issue of saving the extracted file into nested folders. However, it doesn't encrypt the zip file with the password.

using (ZipFile zip = new ZipFile())
{

    zip.Password = "123456";

    zip.AddFile(@"C:\Users\amishrAFS\Documents\Zip_Test\ZipText.txt", "");    //Using the overloaded function
    zip.Save(@"C:\Users\amishrAFS\Documents\Zip_Test\TestZip.zip");
}

The Readme file address the nested folder issue and offers the overloaded function as a solution but it doesn't address it for zip using password. I don't see any examples of it either. Is this a bug or am I not using the proper functions?

Thanks for looking at this.

jshergal commented 1 year ago

I was unable to reproduce this using the currently published library from NuGet (v. 1.16.0). If you can provide a full sample that reproduces this issue, feel free to reopen this.