我试图使用
PHP从sftp服务器下载文件,但我找不到任何正确的文档来下载文件.
- <?PHP
- $strServer = "pass.com";
- $strServerPort = "22";
- $strServerUsername = "admin";
- $strServerPassword = "password";
- $resConnection = ssh2_connect($strServer,$strServerPort);
- if(ssh2_auth_password($resConnection,$strServerUsername,$strServerPassword)) {
- $resSFTP = ssh2_sftp($resConnection);
- echo "success";
- }
- ?>
打开SFTP连接后,下载文件需要做什么?