retrieving PDF file with ServerXMLHTTP object

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

Guest

(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
 
Back
Top