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

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -