PHP download from remote server via sftp

前端 未结 3 1591
不思量自难忘°
不思量自难忘° 2021-02-04 17:05

This may have been asked before, I\'m new to PHP and I\'m trying to learn as much as I can, but this has really thrown me.

Basically what I want to know is, how would I

3条回答
  •  日久生厌
    2021-02-04 17:52

    Here you will find all the examples for what you can do with SFTP using PHP. http://phpseclib.sourceforge.net/sftp/examples.html

    login('username', 'password')) {
           exit('Login Failed');
       }
    
       // outputs the contents of filename.remote to the screen
       echo $sftp->get('filename.remote');
       // copies filename.remote to filename.local from the SFTP server
       $sftp->get('filename.remote', 'filename.local');
    ?>
    

提交回复
热议问题