urlstatus question

Ron runrevron at gmail.com
Wed Oct 28 20:58:34 EDT 2009


Thank you Alex,
No one had replied yet so I kept looking. I found some similar code in  
a project from someone else and realized they were using  
libURLSetStatusCallback so once I found that, I could do the coding  
myself. The pdf docs certainly give the impression that  
libURLDownloadToFile is sufficient without the libURLSetStatusCallback  
but with this, I am getting the update I need and can set the progress  
bar etc.

Thanks again for the reply,
Ron


On Oct 29, 2009, at 3:55 AM, Alex Tweedly wrote:

> I haven't noticed a reply to this .... if there was one and I just  
> missed it, then I offer my apologies (especially if i contradict  
> that answer ;-)
>
> I haven't look at the user guide - this is info from the  
> documentation (dictionary).
>
> The last parameter to libURLDownloadToFile is a status callback  
> called only when the operation is complete (whether it succeeds or  
> fails). To get a periodic status callback, you need to call  
> libURLSetStatusCallback - see the dictionary entry for it and for  
> libURLDownloadToFile
>
> -- Alex
>
> ron barber wrote:
>> Greetings,
>>
>> I am downloading a file from the web to my HD using
>> libURLDownloadToFile. I copied the scripts in Rev's user guide which
>> also says:
>>
>> "As the URLStatus changes periodically throughout the download
>> process, the button's
>> showStatus handler is executed repeatedly. Each time a showStatus
>> message is sent, the
>> handler places the new status in a field. The user can check this
>> field at any time during
>> the file transfer to see whether the download has started, how much  
>> of
>> the file has been
>> transferred, and whether there has been an error. "
>>
>>
>> This sounds like the showstatus message is sent without any further
>> coding from me but I am not getting any intermediate messages, simply
>> 'downloaded' at the end of the download. I've tried 'sending' and
>> 'repeating' but I'm missing something.
>>
>> My script (basically copied from the guide)
>>
>> on mouseUp
>>   put specialFolderPath("desktop")&"/newfile.zip" into newfile
>>   set the fileType to "????zip "
>>   --set the fileType to "ddskdevi"
>>    libURLDownloadToFile myfile,newfile,"showStatus"
>> end mouseUp
>>
>> on showStatus theURL
>>   put the URLStatus of theURL into field "status"
>> end showStatus
>>
>> Thanks,
>> Ron
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list