I am a new software developer . i develop website in asp.net.
I am in problems to upload and download and show link of .zip file.
mu truwl below
this is my .zip file. it loaded in a folder in website
22
I wantshow it in MyPo.zip . when click this link its downloaded in computer.
if any body help me best regurds.

Jay ParekhPosted Mar 5, 2013, 4:57 AM
you can write this code in page load event so that it will make list of all the .zip files
DirectoryInfo directory = new DirectoryInfo(Server.MapPath("~/Files"));
int counter = 0;
foreach (FileInfo file in directory.GetFiles())
{
HyperLink link = new HyperLink();
link.ID = "Link" + counter++;
link.Text = file.Name;
link.NavigateUrl = "Default2.aspx?name="+file.Name;
Page.Controls.Add(link);
Page.Controls.Add(new LiteralControl("
"));
}
and new page named Default2.aspx and in that page load event write below code
protected void Page_Load(object sender, EventArgs e)
{
string fileName = Request.QueryString["name"].ToString();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
Response.TransmitFile(Server.MapPath("~/Files/" + fileName));
Response.End();
}
may be it helps.