ftp problem

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ftp problem

Brad Borch
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?

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

Dave Cragg

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


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

Brad Borch
Thanks, I'll try your suggestion. I wasn't clear about the result; the
seconds kept ticking, meaning the repeat look kept looping, even though
the bytes uploaded were equal to the bytes to be uploaded.

Dave Cragg wrote:

>
> 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
>
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

Dave Cragg

On 20 Jul 2005, at 15:25, Brad Borch wrote:

> Thanks, I'll try your suggestion. I wasn't clear about the result;  
> the seconds kept ticking, meaning the repeat look kept looping,  
> even though the bytes uploaded were equal to the bytes to be uploaded.

That makes sense, and was kind of what I got here when I tested your  
script, except mine stuck at the "contacted" stage, but with time  
also ticking over.

Here's another solution which is closer to your original script, so  
you may feel more comfortable with it:

    libURLftpUpload compress(fData), myURLstring

   repeat until URLStatus(myURLstring) is in "uploaded,error,timeout"
      put URLStatus(myURLstring) && the long time
     wait for messages
   end repeat

The "wait for messages" line will allow background scripts to run.

Cheers
Dave


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution