Can LiveCode FTPS or SFTP?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Can LiveCode FTPS or SFTP?

Post by joel.epsteinBUS31vi » Thu Mar 05, 2015 4:54 pm

Hi all -

I've been successful at writing and fetching files off my server using FTP. That's cool.

But now, my client wants me to use a secure connection. I have a security certificate installed and can sftp via a desktop client. But when I use LiveCode to try to get a file using either sftp or ftps, it fails.

so, for example, this works:

Code: Select all

answer URL "ftp://demo:password@www.myserver.com/readme.txt" 
but this does not:

Code: Select all

answer URL "ftps://username:password@www.myserver.com/readme.txt" 
nor does this:

Code: Select all

answer URL "sftp://username:password@www.myserver.com/readme.txt" 
Can LiveCode do either ftps or sftp? If so, could you please let me know what I need to be doing differently?

Thanks so much for your assistance.

Joel

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: Can LiveCode FTPS or SFTP?

Post by LCNeil » Thu Mar 05, 2015 5:01 pm

Hi Joel,

SFTP & FTPS is not yet support in LiveCode.

A workaround could be to shell out to CURL and initiate the SFTP/FTPS from there. More information on this can be found here-

http://curl.haxx.se/docs/manual.html

Kind Regards,

Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com
-

joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Re: Can LiveCode FTPS or SFTP?

Post by joel.epsteinBUS31vi » Thu Mar 05, 2015 5:04 pm

Thanks for the speedy reply.

Is there a similar option on mobile devices?

Joel

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6956
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Can LiveCode FTPS or SFTP?

Post by FourthWorld » Thu Mar 05, 2015 5:43 pm

As Neil noted, SFTP is slated for a future version of LiveCode, and is not currently supported directly. It can be accomplished by calling curl or wget on desktop systems, but I don't believe those utilities are included by default on most mobile devices (someone please correct me if that's not true).

But whether done through curl or in LiveCode itself when it gets implemented, SFTP is of limited value. It can be a very good choice when making workgroup support apps in which you want to provide general access to a server's files among trusted team members, but is often less efficient and usually less secure than alternatives for simply posting a single file to the server.

The security concern is that SFTP requires embedding the server's FTP account password in the script. While the transaction is of course encrypted over the wire (the "S" in "SFTP"), local on-device probing can conceivably retrieve the password info from RAM before it goes out. Once something as powerful as a site's password has been obtained, everything on the server, and everything that contacts the server, is at risk. Never underestimate the ingenuity of hackers: never embed passwords in anything distributed to the pubic.

The more common solution is not only more secure, but often simpler to implement on the client side: set up the server with a CGI script to receive the file, and on the client use POST over HTTP to send the file.

This obviates the need for embedded passwords, and limits the interaction to do only what you want, without the possibility of using the FTP connection for any other, perhaps undesirable, actions.

There are numerous CGI example scripts for simple file reception in PHP all over the Web, and a few for LiveCode Server in our community.

Here's one:
http://lessons.runrev.com/m/4070/l/4070 ... ode-server
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Re: Can LiveCode FTPS or SFTP?

Post by joel.epsteinBUS31vi » Fri Mar 06, 2015 3:24 pm

Thanks, Richard. That sounds like a great alternative.

I have a Linux server running php. I made a script to accept input from a LiveCode post and all seems to be working well.

I appreciate your input.

Joel

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6956
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Can LiveCode FTPS or SFTP?

Post by FourthWorld » Fri Mar 06, 2015 3:47 pm

Happy to help, Joel. Glad you got a good solution in place.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”