时间:2021-07-01 10:21:17 帮助过:7人阅读
You can also resume this code to (it will not copy directories):
while (false !== ($file = readdir($dirHandle))){ if ($file == "." || $file == "..") continue; echo "Copying file: $file\n"; if(!ssh2_scp_recv($connection, $remoteDir . $file, $localDir . $file)) echo "Could not download: ", $remoteDir, $file, "\n";}If you do not use the full path on the remote folder it will not work:
opendir("ssh2.sftp://{$stream}{$remoteDir}")