Use Ionic Zip with IIS compression activated

Aug 18, 2011 at 11:15 AM
Edited Aug 18, 2011 at 2: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 http://cgi.zdnet.fr/itsupport/microsoft/mvp6.htm)

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:

 

 

Response.Clear();

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, "");
        zip.Save(Response.OutputStream);
}

Response.End();

Thanks a lot to help me fixing that.

PS: it is working under Firefox but not on IE

Aug 19, 2011 at 8:26 AM

Auto answer :

http://support.microsoft.com/kb/841120/en ?

Coordinator
Aug 21, 2011 at 6:22 PM

not sure.

your code looks fine to me.