daved
New Member
Posts: 24
|
Post by daved on Nov 30, 2023 18:02:48 GMT -5
I can use calldll #url, "URLDownloadToFileA",_ to download a specific file from a public site. Is there a way in LB to access a web site that requires a Username/Password pair and then download a specific file.
|
|
Kuron
New Member
Posts: 20
|
Post by Kuron on Nov 30, 2023 18:17:27 GMT -5
It depends on how the username and password are entered on the site. Some sites allow you to do it this way. Example: This site requires a username and password. Access is free though and the site lists the username and password on the site: www.revolutionradioarchives.com/files/So the username is: revradio and the password is: rocks! You can modify the URL to automatically provide the username and password like this: https://revradio:rocks!@revolutionradioarchives.com/files/ Many sites can be accessed this way by providing the username first, then a colon, then the password, the @ sign and the domain and any path and you can target individual files as well, like you are wanting to do. Like this: https://revradio:rocks!@revolutionradioarchives.com/files/audio-bible/John.mp3 Hope this helps! If it is not what you were wanting, I apologize for misreading your post and apologize for wasting your time.
|
|
Kuron
New Member
Posts: 20
|
Post by Kuron on Nov 30, 2023 18:20:36 GMT -5
PS... I can't provide specific LB code, because I can't find my LB 4 registration info or email. I may have to break down and ask Carl, he knows me and knows I am not trying to scam him and I do have my PayPal order info.
|
|
|
Post by xxgeek on Nov 30, 2023 20:21:24 GMT -5
Another option.... In Windows 10 or later you can use the built in curl command as well.
The example below downloads to the DefaultDir$
url$ = "https://revradio:rocks!@revolutionradioarchives.com/files/audio-bible/John.mp3" run "curl -O ";url$;" --user "+chr$(34)+"revradio:rocks!"+chr$(34)',hide 'uncomment the ,hide to hide the download window end [code]
|
|
daved
New Member
Posts: 24
|
Post by daved on Dec 2, 2023 14:07:13 GMT -5
Thanks for the help. The Uname:Pword@domain and curl examples do work!
|
|
|
Post by Brandon Parker on Dec 2, 2023 16:23:30 GMT -5
An LB specific example is not much different...
This is specific code to application I wrote to interface with my pool controller
response$ = HttpGet$("http://";Username$;":";Password$;"@";Winstring(Val(Eval$("PoolMonitor.poolIPAddress";i;".struct")));"/data/get")
Yours would look something like this. You would just need to know the specific address that downloads the file.
yourWebAddress$ = "Some URL goes here!" response$ = HttpGet$("http://";Username$;":";Password$;"@";yourWebAddress$)
{:0)
Brandon Parker
|
|
Kuron
New Member
Posts: 20
|
Post by Kuron on Dec 2, 2023 19:25:39 GMT -5
|
|