I have a link. When user will click this button, I want to run some code that will zip a folder on my desktop and, start downloading it.
Folder path is C:/users/dave/desktop/myFolder
in aspx file:
<asp:HyperLink ID="HyperLink1" runat="server">zip folder and download </asp:HyperLink>
In aspx.vb file:
How can I write code here that will zip a folder on my desktop and start downloading this zip folder? Is there way to do it without downloading extra libraries and plugins?
Add a reference to
System.IO.Compression.FileSystem
Then you can zip the folder using the following:
Then to download it, you can send it in the response: