retrieving PDF file with ServerXMLHTTP object

Discussion in 'ASP .Net' started by =?Utf-8?B?QnJpYW4gQmFybmV0dA==?=, Feb 14, 2004.

  1. (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
    =?Utf-8?B?QnJpYW4gQmFybmV0dA==?=, Feb 14, 2004
    #1
    1. Advertising

  2. Installed the latest Adobe Acrobat Reader and it fixed it. hmph...
    =?Utf-8?B?QnJpYW4gQmFybmV0dA==?=, Feb 15, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SPRFRKR

    Get File from FTP Server - ServerXMLHTTP

    SPRFRKR, Jan 3, 2007, in forum: ASP General
    Replies:
    0
    Views:
    306
    SPRFRKR
    Jan 3, 2007
  2. Spydrlink
    Replies:
    2
    Views:
    136
    Spydrlink
    Jan 11, 2008
  3. anon

    ServerXMLHttp Object

    anon, Aug 24, 2009, in forum: ASP General
    Replies:
    0
    Views:
    839
  4. Ricardo Pog
    Replies:
    1
    Views:
    417
    Austin Ziegler
    Mar 26, 2008
  5. Sean Nakasone
    Replies:
    1
    Views:
    355
    Farrel Lifson
    Apr 14, 2008
Loading...

Share This Page