try { sourcePath=http://192.168.10.119:8010/imgs/ string[] files = System.IO.Directory.GetFiles(sourcePath); using (ZipFile zip = new ZipFile()) { foreach (string s in files) { string fileName = System.IO.Path.GetFileName(s); //string filePath = Server.MapPath("~/SampleFiles/" + fileName); zip.AddFile(s, "files"); } //string destFile = System.IO.Path.Combine(targetPath, fileName); //System.IO.File.Copy(s, destFile, true); //string fld = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); //Response.Write("<script>alert(" + fld + ")</script>"); Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + MediaReference + ".zip"); Response.ContentType = "application/zip"; zip.Save(Response.OutputStream); Response.End(); } RegisterStartupScript("DownloadError", "<script>alert('Folder downloaded successfully.')</script>"); } catch(Exception ex) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)