Drakkon
Diamond Member
I am trying to retrieve a list of files from a SFTP directory using PHP. I have setup SSH2 and have a connection working but I can't seem to find a way to get it to list properly.
here is my connection so far:
----------------------------------
$SSH_CONNECTION = ssh2_connect('services.example.com', 22, array('hostkey'=>'ssh-rsa'));
ssh2_auth_pubkey_file($SSH_CONNECTION,'uname','user/id_rsa.pub','user/id_rsa');
$sftp = ssh2_sftp($SSH_CONNECTION);
--------------------------------------
From there I've tried various stream commands and whatnot to no avail. Any help much appreciated.
here is my connection so far:
----------------------------------
$SSH_CONNECTION = ssh2_connect('services.example.com', 22, array('hostkey'=>'ssh-rsa'));
ssh2_auth_pubkey_file($SSH_CONNECTION,'uname','user/id_rsa.pub','user/id_rsa');
$sftp = ssh2_sftp($SSH_CONNECTION);
--------------------------------------
From there I've tried various stream commands and whatnot to no avail. Any help much appreciated.