Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ssh2_scp_send(3) [php man page]

SSH2_SCP_SEND(3)							 1							  SSH2_SCP_SEND(3)

ssh2_scp_send - Send a file via SCP

SYNOPSIS
bool ssh2_scp_send (resource $session, string $local_file, string $remote_file, [int $create_mode = 0644]) DESCRIPTION
Copy a file from the local filesystem to the remote server using the SCP protocol. PARAMETERS
o $session - An SSH connection link identifier, obtained from a call to ssh2_connect(3). o $local_file - Path to the local file. o $remote_file - Path to the remote file. o $create_mode - The file will be created with the mode specified by $create_mode. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Uploading a file via SCP <?php $connection = ssh2_connect('shell.example.com', 22); ssh2_auth_password($connection, 'username', 'password'); ssh2_scp_send($connection, '/local/filename', '/remote/filename', 0644); ?> SEE ALSO
ssh2_scp_recv(3), copy(3). PHP Documentation Group SSH2_SCP_SEND(3)

Check Out this Related Man Page

SSH2_SFTP_MKDIR(3)							 1							SSH2_SFTP_MKDIR(3)

ssh2_sftp_mkdir - Create a directory

SYNOPSIS
bool ssh2_sftp_mkdir (resource $sftp, string $dirname, [int $mode = 0777], [bool $recursive = false]) DESCRIPTION
Creates a directory on the remote file server with permissions set to $mode. This function is similar to using mkdir(3) with the ssh2.sftp:// wrapper. PARAMETERS
o $sftp - An SSH2 SFTP resource opened by ssh2_sftp(3). o $dirname - Path of the new directory. o $mode - Permissions on the new directory. o $recursive - If $recursive is TRUE any parent directories required for $dirname will be automatically created as well. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Creating a directory on a remote server <?php $connection = ssh2_connect('shell.example.com', 22); ssh2_auth_password($connection, 'username', 'password'); $sftp = ssh2_sftp($connection); ssh2_sftp_mkdir($sftp, '/home/username/newdir'); /* Or: mkdir("ssh2.sftp://$sftp/home/username/newdir"); */ ?> SEE ALSO
mkdir(3), ssh2_sftp_rmdir(3). PHP Documentation Group SSH2_SFTP_MKDIR(3)
Man Page