Download in progress

Dave Cragg dcragg at lacscentre.co.uk
Sat Feb 23 05:24:01 EST 2002


At 6:05 am +0100 23/2/02, Terry Vogelaar wrote:
>How do I make a progress bar that indicates when a (not too small) text file
>on the internet is downloaded?
>So I probably need to know how do I know how large a file on a server is and
>how do I know how many bytes are already downloaded.

You need to use "load" to download the file, and then the urlStatus 
function to track it as it downloads. Something like:


on mouseUp
   put "http://xxx.xx.com/myfile.txt" into tUrl
   load url tUrl
   showStatus
end mouseUp

on showStatus pUrl
   put "http://xxx.xx.com/myfile.txt" into tUrl
   put urlStatus(pUrl)
end showStatus

This will put urlStatus in the message box. You'll see that it shows 
"loading,x,y" as the file is downloading. You can use the values of x 
and y to construct a progress bar.

Cheers

Dave Cragg
(Revolution -- It's Got The Power)



More information about the Use-livecode mailing list