我正在尝试使用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连接,我需要做什么才能下载文件?