locked
Need help using: DotNetZipLib RRS feed

  • Question

  • User698338669 posted

    Hi,

    I want to create a zip file from file list only if the User click on downloding file list. [Creating on demand and send it to user]

    How to make it?

    I'm using:

    DotNetZipLib

    ZipFile zip = new ZipFile();
            // add this map file into the "images" directory in the zip archive
            zip.AddFile("c:\\images\\personal\\7440-N49th.png", "images");
            // add the report into a different directory in the archive
            zip.AddFile("c:\\Reports\\2008-Regional-Sales-Report.pdf", "files");
            zip.AddFile("ReadMe.txt");
            zip.Save("MyZipFile.zip");

    I got this for example,

    what changes I need to do?

    Thanks..

     

    Sunday, May 22, 2011 4:49 AM

All replies

  • User698338669 posted

    Please help me,

    Thanks...

    Sunday, May 22, 2011 10:17 AM
  • User698338669 posted

    Did this:

     

     protected void btnDownload_Click(object sender, EventArgs e)
        {
            Response.Clear();
            Response.ContentType = "application/zip";
            Response.AddHeader("content-disposition", "filename=" + "Test.zip");
    
    
            using (ZipFile zip = new ZipFile())
            {
                FileList objFileList = new FileList();
    
                objFileList = FileList.GetList(Convert.ToInt32(TextBox1.Text));
    
                for (int i = 0; i < objFileList.Count; i++) // Loop through List with for
                {
                    zip.AddFile(Server.MapPath("~/Files/" + objFileList[i].UniqueFileName));
                    i++;
                }
                zip.Save(Response.OutputStream);
            }
        }

    My problem is:

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

    How to make it faster the creation on running time the Zip file?

    Thanks..

     

    Sunday, May 22, 2011 5:31 PM
  • User698338669 posted

    Please help me,

     

    Thanks...

    Tuesday, May 24, 2011 11:11 AM
  • User698338669 posted

    Please help me,

     Thanks...

    Thursday, May 26, 2011 4:56 AM