Google Answers Logo
View Question
 
Q: Listing of files in a directory over SFTP in PHP ( No Answer,   0 Comments )
Question  
Subject: Listing of files in a directory over SFTP in PHP
Category: Computers > Programming
Asked by: mike_sf-ga
List Price: $15.00
Posted: 23 Mar 2006 19:14 PST
Expires: 24 Mar 2006 14:40 PST
Question ID: 711338
How can I get a listing of files in a directory over SFTP in PHP 4.3?

I need to get an array of strings containing the list of files in a
specific remote directory over an SFTP connection.  I am using the
ssh2 PECL package (http://pecl.php.net/package/ssh2) deployed on Free
BSD 4.7.  I can successfully get a connection and even get a specific
file using fopen().

Tried unsuccessfully:
$connection = ssh2_connect($ftp_server, 22);
ssh2_auth_password($connection, $sftp_user_name, $sftp_user_pass);
$sftp = ssh2_sftp($connection);
$dir = dir("ssh2.sftp://$sftp/$ftpPath");

Ideally, I would prefer not to use an external process (proc_open) as
I am using a password for authentication.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy