Following function downloads specified file from server to client.
=============================================
public static void DownloadFiles(string FileName)
{
HttpContext context = HttpContext.Current;
context.Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName);
context.Response.ContentType = "application/xml";
string Path = context.Server.MapPath(FileName);
try
{
context.Response.WriteFile(Path);
}
catch (Exception ex) { }
context.Response.Flush();
context.Response.End();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment