retrieving PDF file with ServerXMLHTTP object
From: Brian Barnett (bwbarnett_at_hotmail.com)
Date: 02/14/04
- Next message: Paul: "Authentication in .NET..... pointers"
- Previous message: Brian Mitchell: "Preventing User from backing up to previous page?"
- Next in thread: Brian Barnett: "RE: retrieving PDF file with ServerXMLHTTP object"
- Reply: Brian Barnett: "RE: retrieving PDF file with ServerXMLHTTP object"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 14 Feb 2004 15:46:07 -0800
(Using the previous ASP technology, not ASP.NET. Sorry if this is the wrong newsgroup. If so, please point me in the right direction.)
I've just about got it working, except the browser is displaying binary data instead of using Adobe Acrobat to display the PDF.
Here is the source code I'm using:
Response.Buffer = False
Response.ContentType = "application/pdf"
set httpReq = Server.CreateObject("Msxml2.ServerXMLHTTP")
httpReq.open "GET", PDFFileURL, false
httpReq.send ""
if (httpReq.status <> 200) then
Response.Write("Error")
else
Response.BinaryWrite httpReq.responseBody
end if
set httpReq = nothing
If I type in the URL of the pdf file directly into the address bar of the browser, it opens it fine. I just can't get it to work using Response.BinaryWrite.
System Info:
W2K Pro
IIS 5.0
IE 6.0
I'd appreciate any suggestions.
Thanks,
Brian Barnett
- Next message: Paul: "Authentication in .NET..... pointers"
- Previous message: Brian Mitchell: "Preventing User from backing up to previous page?"
- Next in thread: Brian Barnett: "RE: retrieving PDF file with ServerXMLHTTP object"
- Reply: Brian Barnett: "RE: retrieving PDF file with ServerXMLHTTP object"
- Messages sorted by: [ date ] [ thread ]