upload - php send file to sftp -


i trying send file sftp error while trying upload file. permissions on remote folder ok.

$connection = ssh2_connect('10.0.10.245', 22); ssh2_auth_password($connection, $ftp_user_name, $ftp_user_pass); $sftp = ssh2_sftp($connection); echo '<br>'; ssh2_scp_send($connection,$file,"/a.xml", 0644); print_r(error_get_last()); 

the error got is:

array  (      [type] => 2      [message] => ssh2_scp_send(): failure creating remote file      [file] => /var/www/fp1/sendftp.php      [line] => 93   )  

any advise?

you start sftp session (ssh2_sftp), while use scp later actual transfer (ssh2_scp_send). not need ssh2_sftp line; , can cause of problem.

while technically possible have both sftp , scp sessions on 1 ssh connection, not expect php support this. though i'm not sure.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -