Hi
i have taken one dropdownlist for select file what u want to download
and also bind with database and i have take one button also for downloading
i have write following a code in button_click for downloading
string fname = DropDownList1.SelectedItem.Text;
string filepath = Server.MapPath(@"~\Upload\" + fname);
FileInfo fi = new FileInfo(filepath);
if (fi.Exists )
{
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment;filename=" + fname);
Response.AddHeader("Content-Length", fi.Length.ToString());
Response.ContentType = "application";
Response.TransmitFile(fi.FullName);
Response.End();
}
it's working only for dropdpwnlist item[0] element can only downloaded
but not working for remaining items in dropdownlist