Loading urls from a protected website
JimAultWins at yahoo.com
Wed Dec 6 13:04:52 EST 2006
On 12/6/06 8:28 AM, "Eric Chatonet" <eric.chatonet at sosmartsoftware.com>
> Hello Richard and Jim,
> Thanks to both of you for your suggestions:
> Richard: trying to add the username and the password to an http url
> unfortunately does not work.
> Jim: I did not think of libURLSetLogField and
> libURLSetStatusCallback: good idea :-)
> Finally as I did not wanted to have too much code to modify...
> I ended by using load with a "ftp" form:
> put "ftp://" & tUserName & colon & tPassword & "@" & tAddress into tUrl
> load url tUrl --
> DisplayProgress tUrl --
> And it works like a charm.
Glad you got your solution. My steps are meant to be blocking (code
execution stops until complete download) since there is no reason to
continue until the entire file is downloaded. In other cases, I use the
same form so that the data gets put into a local variable that dies at the
end of the handler, thus does not stay around in Rev memory.
The 'load url someFileSomeWhere ' both continues to download in the
background and builds the file in memory in order to cache it. Basically,
it is a global that does not die until you
quit Rev/the app, or
unload url someFileSomeWhere
I think of the file/web page cache as Rev downloading the data to memory and
giving it a variable name of "someFileSomeWhere"
Also, I think if you are accessing web pages, repeated 'load url' commands
to the same url means Rev checks the cache first, and if something is there,
it delivers that to your handler, rather than re-downloading. Therefore,
the 'unload' is necessary before a 'load url' to be sure you are getting the
> Le 6 déc. 06 à 16:25, Richard Gaskin a écrit :
>> If it's protected with htaccess you should be able to embed the
>> login in the URL as with FTP:
> Le 6 déc. 06 à 16:48, Jim Ault a écrit :
>> Here is something I use that generates the *progress data* with ftp
>> on mouseup
>> libURLSetLogField "field 2"
>> libURLSetStatusCallback "setPercentage",(the long id of this card)
>> --bunches of other stuff
>> put "trialStackForClient.rev" into FName
>> put url ("ftp://user:firstname.lastname@example.org/web/" & FName) into \
>> go stack stkToRun
>> end mouseup
>> On 12/6/06 7:15 AM, "Eric Chatonet"
>> <eric.chatonet at sosmartsoftware.com>
>>> Hi all,
>>> To update an application from the web that requires downloading many
>>> files, I have built without any problem a process using the non
>>> blocking load command allowing to display a progress bar.
>>> Now I have protected access to the website folders (usual login and
>>> So I can no longer use "load": the command returns a 401 error
>>> (protected access).
>>> I must use ftp that allows to specify a username and a password but I
>>> am no longer able to display download progress :-(
>>> Your thinking will be welcome :-)
> http://www.sosmartsoftware.com/ eric.chatonet at sosmartsoftware.com/
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
More information about the Use-livecode