I am having problems when I tried to run the following code from my asp.net page. The code is from another post (http://stackoverflow.com/questions/5828315/write-pdf-strea
Consider using HttpResponse.TransmitFile (ASP.NET >= 2.0), especially for large files because it writes the file without buffering it into server memory.
Also, make sure you always set the Response.ContentType property to the appropriate MIME type or browsers will sometimes have trouble with downloading your files correctly, especially if you are writing the file from a handler:
Response.ContentType = "application/pdf";
You can use Response.WriteFile instead of all the buffer work.
protected void Page_Load(object sender, EventArgs e)
{
Context.Response.WriteFile(@"C:\Downloads\Test.pdf");
}