More info on PDF issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to open pdf docs using IE via an ASP.NET application written in VB.net. Here is the simple sample I'm trying to use..
'Set the appropriate ContentType
Response.ContentType = "Application/pdf
'Get the physical path to the file
Dim sFilePath As String = ConfigurationSettings.AppSettings("RoutingSheetPath") & "\" & "WO_0000828073_20040102_050309.pdf
'Write the file directly to the HTTP output stream
Response.WriteFile(sFilePath
Response.End(

This is a valid file but it is being returned as the name of the webpage with the .aspx extension. When it is returned I am prompted to save/open. When I open it , it opens in notepad. If I save it as is with the aspx extension and then open it with acrobat it opens fine. I have tried Fiddler to see what is going on and I am desperate to get this fixed.

Thanks in advance
Pat
 
1> Can you send me the content from Fiddler? Simply hit CTRL+C on the
session and drop it in an email.
2> Why not just do a Response.Redirect to the PDF file instead of streaming
it yourself?

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

PatLaf said:
I am trying to open pdf docs using IE via an ASP.NET application written
in VB.net. Here is the simple sample I'm trying to use...
'Set the appropriate ContentType.
Response.ContentType = "Application/pdf"
'Get the physical path to the file.
Dim sFilePath As String =
ConfigurationSettings.AppSettings("RoutingSheetPath") & "\" &
"WO_0000828073_20040102_050309.pdf"
'Write the file directly to the HTTP output stream.
Response.WriteFile(sFilePath)
Response.End()

This is a valid file but it is being returned as the name of the webpage
with the .aspx extension. When it is returned I am prompted to save/open.
When I open it , it opens in notepad. If I save it as is with the aspx
extension and then open it with acrobat it opens fine. I have tried Fiddler
to see what is going on and I am desperate to get this fixed.
 
There's one option to specify attachment filename=....pdf something like
that

PatLaf said:
I am trying to open pdf docs using IE via an ASP.NET application written
in VB.net. Here is the simple sample I'm trying to use...
'Set the appropriate ContentType.
Response.ContentType = "Application/pdf"
'Get the physical path to the file.
Dim sFilePath As String =
ConfigurationSettings.AppSettings("RoutingSheetPath") & "\" &
"WO_0000828073_20040102_050309.pdf"
'Write the file directly to the HTTP output stream.
Response.WriteFile(sFilePath)
Response.End()

This is a valid file but it is being returned as the name of the webpage
with the .aspx extension. When it is returned I am prompted to save/open.
When I open it , it opens in notepad. If I save it as is with the aspx
extension and then open it with acrobat it opens fine. I have tried Fiddler
to see what is going on and I am desperate to get this fixed.
 
Hi Pat,

I'm viewing this post and found that this is a duplicated one with another
two posts in this queue. Both other community members and I have posted
replies in those twos. Please check out them. Also, do you think it
convenitent that we continue to discuss in those twos? If so, please feel
free to post there if you have any further questions. Thanks.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top