Stopping FTP uploads

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
iGerbil
Posts: 12
Joined: Thu Aug 28, 2014 10:39 am

Stopping FTP uploads

Post by iGerbil » Tue Sep 16, 2014 11:34 am

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)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Stopping FTP uploads

Post by Mark » Tue Sep 16, 2014 4:15 pm

Hi,

This cancels the upload:

Code: Select all

unload URL myFtpUrl
where myFtpUrl contains an URL starting with "ftp://".

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

iGerbil
Posts: 12
Joined: Thu Aug 28, 2014 10:39 am

Re: Stopping FTP uploads

Post by iGerbil » Wed Sep 17, 2014 2:49 pm

Great, thanks a lot !!

jrahl
Posts: 3
Joined: Sun Apr 26, 2015 10:30 am

Re: Stopping FTP uploads

Post by jrahl » Sun Apr 26, 2015 10:46 am

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

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Stopping FTP uploads

Post by cmhjon » Mon Aug 10, 2015 10:23 pm

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 :-)

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Stopping FTP uploads

Post by Simon » Mon Aug 10, 2015 10:49 pm

Hi Jon,
Try the resetAll
as long as you are not talking about mobile.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Stopping FTP uploads

Post by cmhjon » Mon Aug 10, 2015 11:43 pm

Hi Simon,

I'd be grateful for a script example.

Thank you so much,
Jon :-)

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Stopping FTP uploads

Post by Simon » Mon Aug 10, 2015 11:56 pm

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.

Code: Select all

on mouseUp
resetAll
end mouseUp
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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

cmhjon
Posts: 175
Joined: Tue Aug 04, 2015 11:55 am

Re: Stopping FTP uploads

Post by cmhjon » Tue Aug 11, 2015 11:57 am

Thank you, Simon!

The resetAll function did the trick. Strange that the unload URL didn't.

Thanks again!
Jon :-)

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Stopping FTP uploads

Post by jacque » Tue Aug 11, 2015 5:29 pm

Unload URL removes a downloaded file from RAM. It doesn't apply to uploading.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Internet”