ftp - How to use SFTP in PHP -
a quick question, im using line scan file in other site "$sfs = scandir('ftp://'" wondering if site using sftp - ssh, should still use command below instead of ftp i'll use sftp? "$sfs = scandir('sftp://'""
i appreciate answer. thanks!
sftp has complete guide @ page.
you should make connection first , can tansfer files.
(copy stream variable in example below @ own direction.
create new file fopen , print $stream in new file)
example php.net:
<?php $connection = ssh2_connect('shell.example.com', 22); ssh2_auth_password($connection, 'username', 'password'); $sftp = ssh2_sftp($connection); $stream = fopen("ssh2.sftp://$sftp/path/to/file", 'r'); ?>
Comments
Post a Comment