Fun at zangOOr Click Here
1 like 0 dislike
90 views
How to create directory and send a file to a remote server
in Education & Reference by (790 points) | 90 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);
by (950 points)

Related questions

1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Feb 21, 2020 in Education & Reference by Sam (1.4k points) | 63 views
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
2 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

1,243 questions
1,398 answers
564 comments
4,237 users