Get a file using XMLHTTP

Discussion in 'ASP General' started by serge, Aug 28, 2004.

  1. serge

    serge Guest

    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
     
    serge, Aug 28, 2004
    #1
    1. Advertising

  2. serge wrote:
    > 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
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Aug 28, 2004
    #2
    1. Advertising

  3. serge

    serge Guest

    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.


    > > 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.
     
    serge, Aug 30, 2004
    #3
    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. Savas Ates
    Replies:
    3
    Views:
    107
    Michael D. Kersey
    Jun 30, 2004
  2. Phil Powell
    Replies:
    3
    Views:
    216
    Martin Honnen
    Jul 25, 2005
  3. vunet
    Replies:
    3
    Views:
    217
    p byers
    Jun 11, 2008
  4. tlang
    Replies:
    4
    Views:
    118
    Diego Vilar
    Mar 13, 2005
  5. yawnmoth

    Msxml*.XMLHTTP vs. Microsoft.XMLHTTP

    yawnmoth, Nov 7, 2006, in forum: Javascript
    Replies:
    11
    Views:
    399
    Matt Kruse
    Nov 9, 2006
Loading...

Share This Page