retrieving PDF file with ServerXMLHTTP object

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top