Sign in to follow this  
Followers 0
ray306

InetGet()

10 posts in this topic

I am trying to download a zip file via HTTP and it would appear that InetGet() should do the trick.

The code is below. Any ideas

CODE
$result=InetGet ( "https://user:pass@www.brisnet.com/secure-bin/brisclub/brisrep.cgi/ggx0107n.zip?drmggx0107n.zip" ,"C:\Horsedownloads", 0 , 0 )

While @InetGetActive

TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)

Sleep(250)

Wend

MsgBox(1,"result","Result of GetInet: "&$result)

of course user and pass are subs for the real username and password.

Thanks for any help

Ray

Share this post


Link to post
Share on other sites



0 , 0 )

Should be

1)

And, I think in the second parameter, you have to use a filename. not a folder.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I am trying to download a zip file via HTTP and it would appear that InetGet() should do the trick.

The code is below. Any ideas

CODE
$result=InetGet ( "https://user:pass@www.brisnet.com/secure-bin/brisclub/brisrep.cgi/ggx0107n.zip?drmggx0107n.zip" ,"C:\Horsedownloads", 0 , 0 )

While @InetGetActive

TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16)

Sleep(250)

Wend

MsgBox(1,"result","Result of GetInet: "&$result)

of course user and pass are subs for the real username and password.

Thanks for any help

Ray

Here is synthax of InetGet

InetGet ( "URL" [,"filename" [, reload [, background]]] )

The HTTP URL doesn't support user and password in the URL string.

Make a search on yahoo with The terms CURL.EXE

Curl does support that anyway to provide a ftp-style interface and thus you can

pick a file like:

curl https://user:pass@www.brisnet.com/secure-bi...drmggx0107n.zip

curl downloading adress :

http://www.curl.haxx.se/download.html

Edited by LOULOU

Share this post


Link to post
Share on other sites

Here is synthax of InetGet

InetGet ( "URL" [,"filename" [, reload [, background]]] )

The HTTP URL doesn't support user and password in the URL string.

Make a search on yahoo with The terms CURL.EXE

Curl does support that anyway to provide a ftp-style interface and thus you can

pick a file like:

curl https://user:pass@www.brisnet.com/secure-bi...drmggx0107n.zip

curl downloading adress :

http://www.curl.haxx.se/download.html

It does actually.

To use a username and password when connecting simply prefix the servername with "username:password@", e.g.

"http://myuser:mypassword@www.somesite.com"


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Thanks for the replies.

I tried changing the parameters as AzKay suggested, still failure.

As to not supporting username:pass it would appear from the docs that it does support that option but I just can't get it to work.

Is there any way to figure out the source of the failure as the return only provides success/failure.

Thanks

Ray

Share this post


Link to post
Share on other sites

Add this on the line after the INetGet().

If @Error Then MsgBox(0, "", @Error)


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Add this on the line after the INetGet().

If @Error Then MsgBox(0, "", @Error)

Thanks AzKat

I did as you suggested

Upon failure it returns a value of 10

I don't see a listing of error codes for this function in the docs

Any idea what 10 means?

Ray

Share this post


Link to post
Share on other sites

No idea. Though, someone else might be able to help you. =3.

Question, Are you sure the url is right?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Here is synthax of InetGet

InetGet ( "URL" [,"filename" [, reload [, background]]] )

The HTTP URL doesn't support user and password in the URL string.

Make a search on yahoo with The terms CURL.EXE

Curl does support that anyway to provide a ftp-style interface and thus you can

pick a file like:

curl https://user:pass@www.brisnet.com/secure-bi...drmggx0107n.zip

curl downloading adress :

http://www.curl.haxx.se/download.html

The only way to do what you want is to download curl.exe

http://curl.haxx.se/download.html

Because an Https protocol doesn't allow an user and a password in the url (see RFC about that)

Try with curl.exe and after we see

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

LOULOU, it works. I've used InetGet() like that for years. Stop saying it doesn't work. It does.

Oh, I see, it's https. That does present a difference. An error of 10 means there was a problem reading the file. If LOULOU is correct, I would have expected a lower error, around 7. I don't know what the problem is and I don't know of any public/private https sites to download from to test.

Edited by Valik

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0