Jump to content

InetGet()


 Share

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
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- #
Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...