array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.ssh2-scp-recv.php', 1 => 'ssh2_scp_recv', ), 'up' => array ( 0 => 'ref.ssh2.php', 1 => 'SSH2 Functions', ), 'prev' => array ( 0 => 'function.ssh2-publickey-remove.php', 1 => 'ssh2_publickey_remove', ), 'next' => array ( 0 => 'function.ssh2-scp-send.php', 1 => 'ssh2_scp_send', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ssh2/functions/ssh2-scp-recv.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL ssh2 >= 0.9.0)
ssh2_scp_recv — Request a file via SCP
Copy a file from the remote server to the local filesystem using the SCP protocol.
session
An SSH connection link identifier, obtained from a call to ssh2_connect().
remote_file
Path to the remote file.
local_file
Path to the local file.
Example #1 Downloading a file via SCP
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
ssh2_scp_recv($connection, '/remote/filename', '/local/filename');
?>