Need to dynamically package some files into a .zip to create a SCORM package, anyone know how this can be done using code? Is it possible to build the folder structure dynam
#region Create zip file in asp.net c#
string DocPath1 = null;/*This varialble is Used for Craetting the File path .*/
DocPath1 = Server.MapPath("~/MYPDF/") + ddlCode.SelectedValue + "/" + txtYear.Value + "/" + ddlMonth.SelectedValue + "/";
string[] Filenames1 = Directory.GetFiles(DocPath1);
using (ZipFile zip = new ZipFile())
{
zip.AddFiles(Filenames, "Pdf");//Zip file inside filename
Response.Clear();
Response.BufferOutput = false;
string zipName = String.Format("Zip_{0}.zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"));
Response.ContentType = "application/zip";
Response.AddHeader("content-disposition", "attachment; filename=" + zipName);
zip.Save(Response.OutputStream);
Response.End();
}
#endregion