I'm looking for a way to stream a PDF file from my server to the browser using .NET 2.0 (in binary).
I'm trying to grab an existing PDF file from a server path and push that up as binary to the browser.
I'm looking for a way to stream a PDF file from my server to the browser using .NET 2.0 (in binary).
I'm trying to grab an existing PDF file from a server path and push that up as binary to the browser.
Response.ContentType = "application/pdf"Response.Headers.Add("Content-Disposition", "attachment: filename=file.pdf");Response.OutputStream as Mr. Kopp said.Step 2 is not strictly necessary, but it's probably a good idea if you don't want the browser to try to save the PDF with the same name as your ASPX file.