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

Read external secure site

I need to read and download some files from an external site. Meaning right now they go to that site ( a finanical secure web site) with their userid, password and their screen has list of files (csv,pdf etc.) they click on it and download.

I am trying to automate this process. Tried with XMLHTTP, but probably security will not let me in.

  Response.Buffer = false
  Dim objXMLHTTP, xml

  Set xml = Server.CreateObject("Microsoft.XMLHTTP")

  xml.Open "GET", "https://somesecuresite.com/acweb/hou-actuate-prd/__login", False, "myid", "mypass"
Response.ContentType = "text/xml"
  Response.Write xml.responseText

  Set xml = Nothing

This doesn't work and returns a 401
Any suggestions ?
When I manually go to that site it generates some querystring characters with a successful login just like hotmail.
My question is : how do I read and download and attachment from a hotmail kind of system
1 Solution
Hi jitganguly,

>>>This doesn't work and returns a 401

please post:
     1.     The complete error message
     2.     The line# of the error
     3.     The corresponding line of code, and previous 5 lines

Best Regards,
jitgangulyAuthor Commented:
It failing in Send statemenet and probably due to its not recognizing my company proxy.
Whenever I go to a external site, it reads proxy information from my browser. SInce I am trying to do it externally (through ASP program), its not recognizng its me.
So I have to somehow pass my credentatial whenever I want to aceesse a external internet site.
The error msgs is

Error 401
FW-1 at cpfw2ny: Unauthorized to access the document.
Authorization is needed for FW-1.
The authentication required by FW-1 for lizt is: password.
Reason for failure of last attempt: Access denied - wrong user name or password

FYI - lizt is the query string I am passing

Question  : How do I bypass proxy ? or send my credential through the URL ?

Check this out.

Proxy Configuration Utility Must Be Run for ServerXMLHTTP to Work

Download Proxycfg.Exe From Following MSDN Web Site At:

Best Regards,
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Are you sure one request is enouth, most of the systems redirect you, and you won't be able to see it from your browser.
Try to use this ASP from home with out any proxy installed - according to you it should work

If system require password/login, you need to login first - i.e. send something to some page, grab cookie and Session ID
and analyze a response, and when make another request for the actual file.
and this another request  - in the headers you should attach cookie , sessionID and so on form the prev. page - in this case everything will work like you are using your browser.

You can also use bridge, another asp file on another computer, that takes your link, grab response and send it to your asp AS-IS if direct connection is not possible.

And, in my programs i'm using slightly different format,

Set http = server.CreateObject("Microsoft.XmlHttp")
 http.open "GET", url, False
 http.send ""
 body =http.responseText

I'm not sure why you assume that you should send password in xml.Open "GET", statement in 99% of servers - you should open login page, fill out form and submit it.
(via ASP program)

Good luck
 this problem is interesting. apollois is probably going right way. i think, you can also use wmi/wsh to login to another machine (if the user you are impersonating has an account there). have a look at this

jitgangulyAuthor Commented:
ok. Tried with proxycfg. But it says no user name specified.
Is there any way I set up the user id while setting proxycfg ?
jitgangulyAuthor Commented:
Can I ask CS to delete this thread and refund my points ?
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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