URL download and Cache problems

Dave Cragg dcragg at lacscentre.co.uk
Thu Dec 16 03:31:25 EST 2004


On 15 Dec 2004, at 23:33, Alex Tweedly wrote:

> At 12:59 15/12/2004 -0800, Richard Gaskin wrote:
>
>> This conversation raises a question -
>>
>> There are currently two ways to download files, the "load" command 
>> and "get URL".
>
> 3 if you count libURLDownloadToFile  (though it's for ftp only)

This works with http too. (Perhaps you were thinkig of 
libUrlFtpUploadFile.)


>
>> It used to be the case that "load" was a better option for longer 
>> downloads and/or if you need to update a progress bar, since it was 
>> the only one of the two that was non-blocking and you could querty 
>> the urlStatus for those downloads.
>>
>> But now that we have the libUrlStatusCallback option, which provides 
>> periodic messages for "get URL", is there any benefit to using 
>> "load"?
>
> Yes, lots of them (I think).

But they can all probably be summarized under one heading, i.e "load" 
is good when you need to get on with something else while the stuff is 
downloading.

Richard's thought may stem from a similar experience to mine. 
Previously, "load" was often preferred because it was the only way to 
show  progress of the download, and not because there was a need to do 
other processing. In my own apps, I almost always need to pause other 
things until a download completes. (e.g. a learner chooses a lesson to 
open, and can't work on it until it has downloaded) "load" wasn't ideal 
for this. But "load" was often recommended over "get" because of this 
ability to show progress. With the libUrlStatusCallback option, I now 
rarely need to use load. It's much simpler to use get.


Caveat:  when using "get", there's no obvious way to abort a download 
before it completes. This should probably go on the to-do list.

Cheers
Dave 



More information about the use-livecode mailing list