Get a file using XMLHTTP

S

serge

Is this the correct newsgroup for this posting?


I have a problem when using these lines of code:

Dim xmlhttp as Object
set xmlhttp = CreateObject("Microsoft.XMLHTTP")
Call xmlhttp.Open("GET", Application.Profiles.ActiveProfile.Server &
"/Test.abc", False):
Call xmlhttp.send("");

when the last line of code is executed, i get the following error message:

"The download of the specified resource has failed. -2146697208"


Application.Profiles.ActiveProfile.Server = http://x.x.x.x/virtualdirectory


What is wrong with this code?


Thank you
 
B

Bob Barrows [MVP]

serge said:
Is this the correct newsgroup for this posting?

Only if you are doing this in server-side asp code. If you are doing it in
client-side code, then .scripting.vbscript would be your best bet, unless
you need to support non-IE browsers, that is, in which case
..scripting.jscript would be better.
I have a problem when using these lines of code:

Dim xmlhttp as Object

No, you're definitely in the wrong place. This is not vbscript, so it can't
be ASP.

Bob Barrows
 
S

serge

Thank you Bob for pointing me to the correct newsgroup, i will post in there
next time for
vbscript related code.

I think i found the cause of my problem. If i try downloading a .ABC file it
works.
My actual problem was downloading .VBA

It looks to me the firewall most likely is blocking the .VBA to be
downloaded
(or maybe the anti-virus), because if i try downloading .EXE, that fails
too.
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top