0

I have a requirement that in one folder we will be having some .pdf files and i need to zip the files for a limited size(zip file shouldn't be more than 10MB) and it could be any number of zip files.

it would be great if any one does this in c#.

Thanks in advance !

  • Possible duplicate of [DotNetZip - Calculate final zip size before calling Save(stream) in C#](http://stackoverflow.com/questions/10815633/dotnetzip-calculate-final-zip-size-before-calling-savestream-in-c-sharp) – Anderson Pimentel Oct 15 '15 at 11:59
  • Yes tried with that but the size is coming wrong using (Ionic.Zip.ZipFile zf = new Ionic.Zip.ZipFile()) { for (int i = 0; i < fileNames.Count(); i++) { zf.AddFile(fileNames[i], string.Empty); } var ms = new MemoryStream(); zip.Save(ms); byte[] fileData = ms.ToArray(); var fileSize = fileData.Length; } – Rajender Reddy Addula Oct 15 '15 at 12:16

0 Answers0