1 like 0 dislike
16 views
How to create directory and send a file to a remote server
asked Jan 4 in Education & Reference by Krish (920 points) | 16 views
    

1 Answer

0 like 0 dislike
$uploadfile="var/www/htnl/test/123.jpg";
$connection = ssh2_connect('IP', 22);
ssh2_auth_password($connection, 'root', 'pwd');
$newpath=str_replace("OLDPATH","NEWPATH",$uploadfile);
$sftp = ssh2_sftp($connection);
ssh2_sftp_mkdir($sftp, "NEWPATH/XYZ/" 0777);
ssh2_scp_send($connection, $uploadfile, $newpath, 0777);
unlink($uploadfile);
answered Jan 4 by Neha (730 points)

Related questions

1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Oct 26, 2017 in Education & Reference by Sam (1,470 points) | 13 views
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Sep 7, 2017 in Education & Reference by Krish (920 points) | 14 views
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

Mathe Forum Schule und Studenten
1,151 questions
1,281 answers
263 comments
1,506 users