FAQ Database Discussion Community


PHP SSH2 operations failing when attempting to upload file to server

php,libssh2,ssh2-sftp
I am currently struggling with using the SSH2 built-in libraries for PHP (running version 5.5). I am trying to upload a file to an SFTP server as the title states however I keep getting a "stream operation failed" error message. After attempting to debug the code itself the connection works,...

SFTP Processbuilder

java,unix,sftp,processbuilder,ssh2-sftp
I have to invoke unix commands from Java and I have to use ProcessBuilder. I want to login through SFTP using key authentication and I want to SFTP the file from local directory to remote location. ProcessBuilder pb = new ProcessBuilder("sftp","-oIdentityFile=privateKey","-b","commands.txt","[email protected]"); Content in commands.txt is put localFileDirectory remoteDirectory exit Is...

php download file from different server

php,ssh2-sftp
My application is on Server A and database in on other server Server B. With mysql outfile into /tmp directory of Server B. I want to download this file using php code on Server A <?php $fullpath = '/tmp/users.csv'; Mysql SELECT ......INTO OUTFILE '$fullpath' FIELDS TERMINATED BY ',' ENCLOSED BY...