Downloading Different Types of File from Server using ASP.NEAAafzal afzal12yAsked Nov 11, 2014, 2:16 AM1.2k.NETDownloading Different Types of File from Server using ASP.NET C#
Joginder Banger12y agoPosted Nov 11, 2014, 2:30 AMI think you have no time other wise you fill information correct. I hope next time you fill correct information
Joginder Banger12y agoPosted Nov 11, 2014, 2:29 AMHi Afzal afzal, first of all welcome to c# corner family and plz correct the format of question. 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 BangerPosted Nov 11, 2014, 2:30 AM
Joginder BangerPosted Nov 11, 2014, 2:29 AM
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