Error While downloading in Chrome

Jun 28, 2011 at 9:20 AM

Hey Guys,

 

When i am trying to generate a zip file and allow user to save it to their desktop i am getting an "Interrupted" Error in chrome this works fine in FF. I am really stuck here and i need some help ASAP.

the code i am using is pretty basic, Please Advice if anyone ran into this issue 

protected void CreateZipFile(ArrayList files)
    {
        Response.Clear();
        Response.BufferOutput = false;
        Response.ContentType = "application/zip";
        Response.AddHeader("Content-Disposition", "attachment; filename=EKSuccessBrands.zip");
        
        using (ZipFile zip = new ZipFile())
        {
            foreach (string fileName in files)
            {
                ZipEntry e = zip.AddFile(fileName, "EKSuccessBrands");
            }
            zip.Save(Response.OutputStream);
        }
        Response.Close();
        Response.End();
    }

Coordinator
Jul 5, 2011 at 2:54 AM

Maybe don't call Response.End().  It throws an exception on the server side, which is probably not what you want.

 

Jul 5, 2011 at 11:20 AM

Thanks! i will try it out and let you know. After spending a lot of time i have changed this to use sharzip library but i am still keen on figuring this out.