On Thu, 19 Apr 2007 15:40:25 -0400
Brian Dailey <[EMAIL PROTECTED]> wrote:

> Have any of you guys had any experience doing sftp transfers with PHP? I 
> need something fairly robust that allows me to confirm that the file did 
> indeed arrive intact.
> 
> I've looked into libssh2 (using ssh2.sftp:// wrapper) but I've had 
> little luck with that. The next best thing I've found is being able to 
> use a key to use ssh without entering a password (something I've done 
> before, but not with PHP).

I don't know anything about the libssh2 extension but you could simply
use popen to call scp. To validate the file was transferred successfully
you could then follow up with a call to popen and a command like:

 ssh host.foo.net "ls -l file.txt"

and then parse the size from the output and compare it to the local
file size.

Mike

-- 
Michael B Allen
PHP Active Directory Kerberos SSO
http://www.ioplex.com/
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to