Software Development How to Download any file from ASP.NET You know, some formats (txt, gif etc.) will be shown on the browser rather than downloading when we try. Below is the script which will help you to download any file. <!--[if !supportLineBreakNewLine]--> <!--[endif]--> Response.Clear(); Response.AddHeader(“Content-disposition”, “attachment; filename=”); Response.WriteFile(“C:\”); Response.End();
modified on Thursday, February 21, 2008 1:27 PM