Wrong informations about Indy edition and SFTP?
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller
Wrong informations about Indy edition and SFTP?
Sorry if this post is not in the right section, but I don't understand something about LC networking abilities.
I used to use the Community edition for my personal use. As I wanted to use SFTP, I bought the Indy edition after reading on LC website that Indy edition offers SFTP : Now, when I'm trying to upload files with SFTP using tsNet, I see in LC lessons that SFTP requires the Business editon! Same limitation can be read on Tech Strategies website, in tsNetGetFile() function documentation.
It seems that only FTPS is allowed by the Indy edition. So, I would like to know if I bought the Indy version for nothing, relying on a wrong information, or if there is something that I did not understand.
Thank you.
I used to use the Community edition for my personal use. As I wanted to use SFTP, I bought the Indy edition after reading on LC website that Indy edition offers SFTP : Now, when I'm trying to upload files with SFTP using tsNet, I see in LC lessons that SFTP requires the Business editon! Same limitation can be read on Tech Strategies website, in tsNetGetFile() function documentation.
It seems that only FTPS is allowed by the Indy edition. So, I would like to know if I bought the Indy version for nothing, relying on a wrong information, or if there is something that I did not understand.
Thank you.
-
- Site Admin
- Posts: 323
- Joined: Thu Feb 23, 2006 7:59 pm
- Location: UK
Re: Wrong informations about Indy edition and SFTP?
You can use sFTP in Indy, but only for blocking actions, not asynchronously. Its the asynchronous feature that requires Business.
I hope this helps,
Regards,
Heather
Customer Services Manager
LiveCode Ltd
I hope this helps,
Regards,
Heather
Customer Services Manager
LiveCode Ltd
Re: Wrong informations about Indy edition and SFTP?
OK, I understand. Thank you for your reply, Heather.
It's confusing because tsNetUploadFileSync() function sometimes causes a script error "execution error at line n/a (external: unlicensed) near "tsNet".
For example :
script error --> execution error at line n/a (external: unlicensed) near "tsNet"
--> tsneterr: (1) Protocol "ssh" not supported or disabled in libcurl
--> tsneterr: (28) Operation timed out
And if I use working settings in my FTP client:
--> tsneterr: (56) Recv failure: Connection reset by peer
As it's a shared hosting service (OVH), I can't modify server's settings. Anybody can tell me what am I doing wrong?
Thank you.
Edit
I just tried the following with the console:
Password is of course asked, but uploading works.
It's confusing because tsNetUploadFileSync() function sometimes causes a script error "execution error at line n/a (external: unlicensed) near "tsNet".
For example :
Code: Select all
put "/Volumes/SSD/myFile.txt" into tFileToUpload
put "myFile.txt" into tFileName
put "/pathToDistantDirectory/" into tFtpDirectory
put "theUser" into pSettings["username"]
put "thePassword" into pSettings["password"]
put true into pSettings["use_ssl"]
put "sftp://ssh.mySharedHost.com:22" into tFtpServer
local tHeaders, tResultCode, tBytes, tRecvHeaders, tResult
tsNetUploadFileSync(tFileToUpload, tFtpServer & tFtpDirectory & slash & tFileName, tHeaders, tRecvHeaders, tResultCode, tBytes, pSettings) into tResult
Code: Select all
put "ssh://ssh.mySharedHost.com:22" into tFtpServer
Code: Select all
put "ftp://ssh.mySharedHost.com:22" into tFtpServer
And if I use working settings in my FTP client:
Code: Select all
put "ssh.mySharedHost.com:22" into tFtpServer
As it's a shared hosting service (OVH), I can't modify server's settings. Anybody can tell me what am I doing wrong?
Thank you.
Edit
I just tried the following with the console:
Code: Select all
sftp theUser@ssh.mySharedHost.com:{remote_dir} <<< $'put {local_file_path}'
Re: Wrong informations about Indy edition and SFTP?
After several tests, and looking sample_sync_stack.livecode's code, I found using tsNetUploadSync instead of tsNetUploadFileSync with an URL like "sftp://..." works and doesn't trigger a script error with the Indy version...Zax wrote: ↑Thu May 02, 2019 9:17 amput "sftp://ssh.mySharedHost.com:22" into tFtpServer
local tHeaders, tResultCode, tBytes, tRecvHeaders, tResult
tsNetUploadFileSync(tFileToUpload, tFtpServer & tFtpDirectory & slash & tFileName, tHeaders, tRecvHeaders, tResultCode, tBytes, pSettings) into tResult[/code]
script error --> execution error at line n/a (external: unlicensed) near "tsNet"
So, my problem is solved but this behavior looks a little strange.
-
- VIP Livecode Opensource Backer
- Posts: 39
- Joined: Wed Apr 11, 2012 10:28 pm
Re: Wrong informations about Indy edition and SFTP?
Hi,
The Indy version of LC (and the included tsNet networking library) does not support transferring data via SFTP or SMTP directly to or from a file on the local system. You need to transfer the data using variables (storing/reading the file data via a variable) and perform any local file system operations separately. This means, for example, that the tsNetUploadSync function works in Indy for SFTP transfers, but not the tsNetUploadFileSync function.
This limitation doesn’t exist in the Business edition of LC.
Hope that helps,
Charles
The Indy version of LC (and the included tsNet networking library) does not support transferring data via SFTP or SMTP directly to or from a file on the local system. You need to transfer the data using variables (storing/reading the file data via a variable) and perform any local file system operations separately. This means, for example, that the tsNetUploadSync function works in Indy for SFTP transfers, but not the tsNetUploadFileSync function.
This limitation doesn’t exist in the Business edition of LC.
Hope that helps,
Charles
Re: Wrong informations about Indy edition and SFTP?
Hello Charles,

That's what I finally found after numerous tests!... And It's different from what Heather replied:charlesBUSd8qF wrote: ↑Fri May 03, 2019 10:01 amThe Indy version of LC (and the included tsNet networking library) does not support transferring data via SFTP or SMTP directly to or from a file on the local system.
Once again, I finally used SFTP with my Indy version, so I no longer have problems, but I think documentation could be a little more accurateheatherlaine wrote: ↑Wed May 01, 2019 3:03 pmYou can use sFTP in Indy, but only for blocking actions, not asynchronously. Its the asynchronous feature that requires Business.
