Re: Stream pdf to browser
- From: "Rick" <rfemmer@xxxxxxxxxxxxxxxxx>
- Date: Thu, 10 May 2007 09:01:33 -0500
Thanks Steven!
That works the problem seems to be in:
Response.AddHeader("content-disposition",
"attachment;filename=YourReport.pdf")
If it is set to "inline" that's causing the problem, but is there a way to
turn off the save as prompt so the file automatically opens?
"Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23ILAdjskHHA.1140@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Rick,
Will it work if you directly access that separate aspx page to display the
pdf document?
Also, you can use Response.End instead of Flush to close the response
stream. Here is the test page code I used which work correctly on my side.
You can also have a test against it:
========================
Partial Class vb_FilePage
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
RenderFile()
End Sub
Protected Sub RenderFile()
Dim filename As String
filename = Request.QueryString("fn")
Dim buffer As Byte()
buffer = GetPDFBuffer(filename)
Response.ClearHeaders()
Response.ClearContent()
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition",
"attachment;filename=YourReport.pdf")
Response.End()
End Sub
End Class
===============================
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
.
- References:
- Stream pdf to browser
- From: Rick
- RE: Stream pdf to browser
- From: Steven Cheng[MSFT]
- Re: Stream pdf to browser
- From: Rick
- Re: Stream pdf to browser
- From: Steven Cheng[MSFT]
- Stream pdf to browser
- Prev by Date: Re: get returning user for forms auth?
- Next by Date: Re: Stream pdf to browser
- Previous by thread: Re: Stream pdf to browser
- Next by thread: Re: Stream pdf to browser
- Index(es):