Use Ionic Zip with IIS compression activated

Aug 18, 2011 at 10:15 AM
Edited Aug 18, 2011 at 1:31 PM

Hello all, I use Ionic Zip and it was working fine. Today, in order to improve the speed of loading my pages, I activate the IIS compression feature (I followed this tutorial

Now, all the archive created are corrupted when trying to download them.Do you know a solution ?


here is my code to generate the archive:




System.Web.HttpContext c = System.Web.HttpContext.Current;
string archiveName = String.Format("archive-{0}.zip", DateTime.Now.ToString("yyyy-MM-dd-HHmmss"));
 Response.ContentType = "application/x-zip-compressed";
 Response.AddHeader("content-disposition", "attachment; filename=" + archiveName);

using (ZipFile zip = new ZipFile())
        // filesToInclude is a string[] or List<string>
        zip.AddFiles(filesToInclude, "");


Thanks a lot to help me fixing that.

PS: it is working under Firefox but not on IE

Aug 19, 2011 at 7:26 AM

Auto answer : ?

Aug 21, 2011 at 5:22 PM

not sure.

your code looks fine to me.