Get xml from http and upload it to webdav

Hi!

Im looking for a solution for how to get an xml file
from http and upload that file to webdav with username and password
security.
The scenario should look like this.
My webdavserver address with username and password = xml file from http site

I have managed to get the xml file correctly by using the
MSXML2.XMLHTTP.3.0 object:
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")

and i have managed to save that xml file correctly to harddrive using the ADODB.Stream object:
Set oStream = CreateObject("ADODB.Stream")

But i don't want to save the file to harddrive first, i want to upload it directly to webdav.

I tried to use:
oXMLHTTP.Open "PUT", "my_webdav_server", false, "username", "password"
then the file was saved to webdav but it was empty.


So the question is:
Is it possible to upload the xml file to webdav directly from the
oXMLHTTP object or from the oStream object.
Please help me with some example code since i'm a google it, try it, sometimes it works programmer
Thanks in advanced.

         

February 9th, 2015 8:39am

Not possible.  A file is a file and a string is a string.  How can a string become a file.  WEBDAV wants a file.  WEBDAV allows you to use copy to copy a file.  Just because a server supports WEBDAV does not make it work automatically.  You must attach a drive to the WEBDAV enables server and copy the file to the mapped drive.  WEBDAV also supports development but it is all done through a virtual drive provider.

If you do use a put then this "oXMLHTTP" does not contain the file.  It contains a stream reference that you can access to download a page or object.

Free Windows Admin Tool Kit Click here and download it now
February 9th, 2015 12:09pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics