This project is read-only.

Creating Zip file on client request..

May 27, 2011 at 11:59 AM
Edited May 27, 2011 at 12:01 PM


When I add to Zip big files it's take a long time until it's making a zipFile on running time,

Howto make the creation of the zip file faster on running time?

 I did this:



protected void btnDownload_Click(object sender, EventArgs e) 
        Response.ContentType = "application/zip"; 
        Response.AddHeader("content-disposition", "filename=" + ""); 
        using (ZipFile zip = new ZipFile()) 
            FileList objFileList = new FileList(); 
            objFileList = FileList.GetList(Convert.ToInt32(TextBox1.Text)); 
            for (int i = 0; i < objFileList.Count; i++) 
                zip.AddFile(Server.MapPath("~/Files/" + objFileList[i].UniqueFileName)); 
May 27, 2011 at 7:44 PM

It takes a long time to compress many many files.

If you do it often you can cache the results, and then you don't need to create the file, with each new request. 


May 27, 2011 at 9:43 PM

So I should Create the Zip file at server and save it for downloading it later?

that what ur telling me?


May 29, 2011 at 9:35 PM

Well yes, that is one way to make it faster.