Rajesh Dintakurthi

Rajesh Dintakurthi

  • 1.4k
  • 274
  • 11.7k

How to compress the folder? and download the zip file

Aug 9 2018 9:00 AM
protected void Submit_Click(object sender, EventArgs e)
{
string path = Server.MapPath("~/images/");//Location for inside Test Folder
string[] Filenames = Directory.GetFiles(path);
using (ZipFile zip = new ZipFile())
{
zip.AddFiles(Filenames, "Project");//Zip file inside filename
zip.Save(@"C:\Users\user\Desktop\Projectzip.zip");//location and name for creating zip file
}
}

Answers (1)