How to set zip folder best compression and set a password for Zip folder, I have few Code that i am used please help me how to set best compression and password for zip folder.
using (var zipStream = new MemoryStream())
{
zipFile.Save(zipStream);
zipStream.Seek(0, SeekOrigin.Begin);
CloudBlockBlob cblob = container.GetBlockBlobReference("MockTestZip/MT-" + this.mockExamId + ".zip");
cblob.UploadFromStream(zipStream);
}
I just added these two lines in it but password is not set in zip folder in azure blob storage
zipFile.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;
zipFile.Password = "encrypt";
According to your description, I leverage DotNetZip version 1.10.1 to test this issue on my side. And here is the remark about the
Password
property inZipFile
:Based on your scenario, I assumed that you could store the files in a zip file without password, and then store the zip file within a second outer zip file with password as follows: