Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Respected Sir/Mam
i am using VS2008, ASP.NET, SQ-Server 2008,c #,
How can create zip folder on server,
How can download zip folder from server using asp.net 3.5

Thanks All
Posted

1 solution

For creating a zip file see : Create ZIP Files From An ASP.NET Application[^]
For download add a Button and in its click event use the code below:
C#
protected void Button_Click(object sender, EventArgs e)
    {

        Response.ContentType = "application/x-zip-compressed";
        Response.AppendHeader("Content-Disposition", "attachment; filename=x.zip");
        Response.TransmitFile(Server.MapPath("~/x.zip"));
        Response.End();

    }

Server.MapPath("~/x.zip") is the path of the zip file
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900