|
Friday, 27 January 2012 10:45 |
// downloading a file in asp.net
string attachment = "attachment; filename=" + file;
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("content-disposition", attachment);
HttpContext.Current.Response.ContentType = "application/text";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default;
HttpContext.Current.Response.TransmitFile(string.Concat(DownloadFilePath));
HttpContext.Current.Response.End();
 Read more: |