1 like 0 dislike
37 views
How to create directory and send a file to a remote server
asked Jan 4, 2018 in Education & Reference by Krish (800 points) | 37 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, 2018 by Neha (570 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,290 points) | 29 views
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
asked Jan 4, 2018 in Education & Reference by Sam (1,290 points) | 193 views

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,186 questions
1,324 answers
277 comments
1,638 users