Page 1 of 1
Stopping FTP uploads
Posted: Tue Sep 16, 2014 11:34 am
by iGerbil
Does anyone know how to stop FTP uploads initiated with libURLftpUploadFile ?
You can set a callback message, but there is not evident command to stop the FTP session; you normally use CTRL-C when working from terminal, but from Livecode ?
It can be useful if a large upload is in progress and you want to stop it or reset because there was a drop in internet connection (FTP in Livecode seems to detect only server-generated errors; if you or someone else unplug the cable it juts hangs there forever)
Re: Stopping FTP uploads
Posted: Tue Sep 16, 2014 4:15 pm
by Mark
Hi,
This cancels the upload:
where myFtpUrl contains an URL starting with "ftp://".
Mark
Re: Stopping FTP uploads
Posted: Wed Sep 17, 2014 2:49 pm
by iGerbil
Great, thanks a lot !!
Re: Stopping FTP uploads
Posted: Sun Apr 26, 2015 10:46 am
by jrahl
Hey,
How can I cancel a download on a mobile device? For other platforms 'unload' and 'resetAll' seem to be the trick, but neither of those are supported for mobile (according to the Dictionary).
Regards,
Jaimee
Re: Stopping FTP uploads
Posted: Mon Aug 10, 2015 10:23 pm
by cmhjon
Hello,
I am building an FTP uploader app and tried the unload URL script shown above but it doesn't seem to stop an upload in progress.
Can anyone explain further how this is supposed to work? Script examples?
New to LC.
Thanks,
Jon

Re: Stopping FTP uploads
Posted: Mon Aug 10, 2015 10:49 pm
by Simon
Hi Jon,
Try the resetAll
as long as you are not talking about mobile.
Simon
Re: Stopping FTP uploads
Posted: Mon Aug 10, 2015 11:43 pm
by cmhjon
Hi Simon,
I'd be grateful for a script example.
Thank you so much,
Jon

Re: Stopping FTP uploads
Posted: Mon Aug 10, 2015 11:56 pm
by Simon
Hi Jon,
The Dictionary is your best friend
Examples:
if the openSockets is not empty then resetAll
Now if you examine that you'll see that you don't really need anything more than resetAll, the rest is all if...then.
But an if/then check can be useful to check for a specific socket and then you'd "close socket" so only one gets closed. (see the Dictionary)
Simon
Re: Stopping FTP uploads
Posted: Tue Aug 11, 2015 11:57 am
by cmhjon
Thank you, Simon!
The resetAll function did the trick. Strange that the unload URL didn't.
Thanks again!
Jon

Re: Stopping FTP uploads
Posted: Tue Aug 11, 2015 5:29 pm
by jacque
Unload URL removes a downloaded file from RAM. It doesn't apply to uploading.