XMLHTTP + Download a file

Posted on 2006-04-09
Last Modified: 2008-03-17
I want to download a mydata.pdf file from the webserver to the c:\temp folder. How do I do that using XMLhttp and using verbs such as Get,Post or Put. Code example or snippet would be of great help.

Dim xmlhttp As New Msxml2.xmlhttp
xmlhttp.Open "GET", "http://localhost/mydata.pdf", False

What do I do next?
Question by:Quicklearner07
    LVL 13

    Accepted Solution

    LVL 26

    Assisted Solution

    XMLHTTP.responseStream returns the PDF in an IStream.

    Get the file just like you are showing and then take the responseStream
    and save it to a file.

    The "Getting Binary Data" part of the 4GuysFromRolla link above shows you
    how to get binary data into your browser instance.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API ( has made its way into the popular lexicon of the English language.  A few years ago, …
    Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now