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");
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?
Member
161 Points
1482 Posts
Need help using: DotNetZipLib
May 22, 2011 04:49 AM|b007|LINK
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
I got this for example,
what changes I need to do?
Thanks..
Member
161 Points
1482 Posts
Re: Need help using: DotNetZipLib
May 22, 2011 10:17 AM|b007|LINK
Please help me,
Thanks...
Member
161 Points
1482 Posts
Re: Need help using: DotNetZipLib
May 22, 2011 05:31 PM|b007|LINK
Did this:
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..
Member
161 Points
1482 Posts
Re: Need help using: DotNetZipLib
May 24, 2011 11:11 AM|b007|LINK
Please help me,
Thanks...
Member
161 Points
1482 Posts
Re: Need help using: DotNetZipLib
May 26, 2011 04:56 AM|b007|LINK
Please help me,
Thanks...
</div>