• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 542
  • Last Modified:

XMLHTTP + Download a file

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?
2 Solutions
Eddie ShipmanAll-around developerCommented:
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.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now