Claim your Biolink Click Here
1 like 0 dislike
228 views
How to create directory and send a file to a remote server
in Education & Reference by (1.1k points) | 228 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 (1.1k points)

Related questions

2 like 0 dislike
2 answers
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Feb 21, 2020 in Education & Reference by Sam (1.6k points) | 205 views
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Oct 26, 2017 in Education & Reference by Sam (1.6k points) | 214 views
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,312 questions
1,473 answers
569 comments
4,809 users