ftp problem

Dave Cragg dcragg at lacscentre.co.uk
Tue Jul 19 17:44:55 EDT 2005


On 19 Jul 2005, at 18:33, Brad Borch wrote:

> I have a script to upload a file to an ftp site:
>
>   libURLftpUpload compress(fData), myURLstring
>
>   repeat while URLStatus(myURLstring) is NOT "uploaded"
>      put URLStatus(myURLstring) && the long time
>   end repeat
>
> but this is the message I get:
>
> uploading, 511814,511814 1:30:32 PM
>
> so it looks like the file is completely uploaded, but the server  
> isn't acknowledging it or something?

I think what you are seeing is what you would expect. The message is  
the last status displayed prior to the status changing to "uploaded".  
Once it changes, your repeat loop will exit and no further status  
messages will appear.

However, the repeat loop after the libUrlFtpUpload is not a good  
idea. I'm surprised you are even seeing the "uploading" message.  
libUrl carries out everything in a normal Rev script. The repeat loop  
will run continuouly and block other scripts running.

The script below is a safer way to handle this:

on mouseUp ## or in whatever handler
   libURLftpUpload compress(fData), myURLstring
   showStatus myURLstring
end mouseUp

on showStatus pUrl
   put urlStatus(pUrl) into tStatus
   put tStatus
   if tStatus is not among the items of "uploaded,error,timeout" then
     send "showStatus pUrl" to me in 50 milliseconds
   end if
end showStatus


Cheers
Dave





More information about the use-livecode mailing list