Downloading Different Types of File from Server using ASP.NE
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Joginder BangerRank #360 · 7K reputationPosted Nov 10, 2014, 9:29 PM EST
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = gvDetails.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "image/jpg";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath(filePath));
Response.End();
check this link a complete solution as per your need.
http://www.aspdotnet-suresh.com/2012/02/saveupload-files-in-folder-and-download.html
Joginder BangerRank #360 · 7K reputationPosted Nov 10, 2014, 9:30 PM EST