Here is the sample code to download a file using ASP .NET
try
{
System.String filename = "myFile.txt";
Response.ContentType = "APPLICATION/OCTET-STREAM";
System.String disHeader = "Attachment; Filename=\"" + filename +
"\"";
Response.AppendHeader("Content-Disposition", disHeader);
System.IO.FileInfo fileToDownload = new
System.IO.FileInfo("C:\\download\\myFile.txt");
Response.Flush();
Response.WriteFile(fileToDownload.FullName);}
catch (System.Exception e)
{
SupportClass.WriteStackTrace(e, Console.Error);
}