Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void ZipDownload()
- {
- var zip = new ZipFile(@"C:\Users\(myuser)\Desktop\desktop.zip");
- Response.Clear();
- Response.AddHeader("content-disposition", "attachment;filename=docs.zip ");
- Response.ContentType = "application/zip";
- using (var memoryStream = new MemoryStream())
- {
- zip.Save(memoryStream);
- Response.BinaryWrite(memoryStream.ToArray());
- }
- Response.End();
- }
Add Comment
Please, Sign In to add comment