How to connect to an SFTP server

I need to integrate as external library the “phpseclib” in order to make an SFTP connection and put/get files to/from an SFTP server.

Otherwise I’d like to use PHP ssh2_connect() function on a Scriptcase 9.7 installed on a Windows server.

Has anyone already done this and can help me?

1 Like

Hola, pudiste implementar “phpseclib” en scriptcase???

Hi,
did you make it?

I’m trying to use this library, I’ve used composer, but I don’t know how to install the library in SC. I get: Error: Failed opening required '…/_lib/libraries/grp/phpseclib/Net/SSH2

thanks and regards.

Update
It is already working.

Steps:
1.Download composer: Composer (getcomposer.org)
2.Run: composer require phpseclib/phpseclib:~3.0
3.Make a zip file with the library (including autoload.php and folders composer, phpseclib and paragonie)
4.Create an external library in SC with the name phpseclib
5.Upload the zip file into the library
6.Create a blank app
7.Import the library: sc_include_library(“prj”, “phpseclib”, “autoload.php”,true,true);
8.Use the class:
$sftp = new \phpseclib3\Net\SFTP($server);
if (!$sftp->login($user, $pass) {
exit(‘Login Failed’);
}

2 Likes