How to Download in in file
Download for pdf,documents,and video and audio use c# use in my project use download any file ...
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajesh GamiPosted Apr 14, 2018, 2:24 AM
Rajesh GamiPosted Apr 12, 2018, 10:28 PM
Index
Rafnas T PPosted Apr 6, 2018, 3:06 AM
Jyothi AugustinePosted Mar 16, 2018, 5:57 AM
Jyothi AugustinePosted Mar 16, 2018, 5:54 AM
Rajeesh MenothPosted Jul 4, 2016, 12:55 AM
Munesh SharmaPosted Jul 3, 2016, 12:55 PM
Manoj BhoirPosted Jul 3, 2016, 12:49 PM
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;response.ClearContent();response.Clear();response.ContentType = "APPLICATION/OCTET-STREAM";response.AddHeader("Content-Disposition", "attachment; filename=" + yourfileName + ";");response.TransmitFile(Server.MapPath("FileName"));response.Flush();response.End();Nilesh SawardekarPosted Jul 3, 2016, 11:58 AM
NitinPosted Jul 3, 2016, 11:52 AM
{
try
{
string strURL = txtFileName.Text;
WebClient req = new WebClient();
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearContent();
response.ClearHeaders();
response.Buffer = true;
response.AddHeader("Content-Disposition", "attachment;filename=\"" + Server.MapPath(strURL) + "\"");
byte[] data = req.DownloadData(Server.MapPath(strURL));
response.BinaryWrite(data);
response.End();
}
catch (Exception ex)
{
}
}