Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Get a web file from a secure site (Inet and InternetResult objects)

47 views
Skip to first unread message

Marco Meoni

unread,
Jul 6, 2006, 3:37:43 AM7/6/06
to
I'm trying to download a file on a password-secured site (squid proxy).
The code I use is here below, but all I get is this html:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>401 Authorization Required</TITLE>
</HEAD><BODY>
<H1>Authorization Required</H1>
This server could not verify that you are authorized to access the document
requested. Either you supplied the wrong
credentials (e.g., bad password), or your browser doesn't understand how to
supply the credentials required.<P>
<P>Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
</BODY></HTML>

Anyway, If I connect to a not secure site, my code works fine and I get the
correct blob.
The code is:

Inet ln_inet
n_ir ln_ir // this object overloads InternetData method of
InternetResult object

THIS.GetContextService("Internet", ln_inet)
ln_ir = CREATE n_ir
ln_inet.GetURL("http://mysite.com/index.html, ln_ir)))
Messagebox("page source", String(ln_ir.get_page()))


How to specify username/password for a site accessed via proxy? The Inet
powerbuilder nv object doesn't allow to specify usr/pwd (unlike of VB's)
Please help me.

Marco


Bruce Armstrong [TeamSybase]

unread,
Jul 6, 2006, 9:02:16 AM7/6/06
to

Well, it depends how the site is trying to authenticate you. Some
sites allow you to pass a username/password as part of the URL:

http://www.cs.rutgers.edu/~watrous/user-pass-url.html

On 6 Jul 2006 00:37:43 -0700, "Marco Meoni" <marco...@cern.ch>
wrote:

Marco Meoni

unread,
Jul 7, 2006, 5:37:34 AM7/7/06
to
I feel shame... it was very easy to solve...:P
Marco

"Bruce Armstrong [TeamSybase]" <NOCANSPAMbru...@teamsybase.com>
wrote in message news:m22qa2dde1vgctb2i...@4ax.com...

0 new messages