Using DotNetZip library in my vb.net application, I was able to zip a folder but unable to download. I know there is something missing here but I cannot figure out what. any feedback would be greatly appreciated.
Private Sub ZipFolder(ByVal FolderToZip As String)
Response.BufferOutput = False
app.Events.Write("we are here 1")
Dim archiveName As String = String.Format(FolderToZip & ".zip", DateTime.Now.ToString("yyyy-MMM-dd-HHmmss"))
app.Events.Write("archiveName = " & archiveName)
Response.ContentType = "application/zip"
Response.AddHeader("content-disposition", "filename=" + archiveName)
app.Events.Write("we are here 2")
Using zip As ZipFile = New ZipFile()
zip.Save(FolderToZip & ".zip")
' Send the output to the client.
app.Events.Write("we are here 3")
app.Events.Write("we are here 4")