SFTP from within PHP

前端 未结 5 1416
别那么骄傲
别那么骄傲 2020-11-27 07:17

I\'m in the process of building an web app that will, besides other things, need to connect to a FTP server to download or upload files. The application is written in PHP an

5条回答
  •  甜味超标
    2020-11-27 07:28

    Yes, you can do that with cURL. To switch from FTP to SFTP all you have to do is to change protocol option form CURLPROTO_FTP to CURLPROTO_SFTP.

    cURL supports following protocols: HTTP, HTTPS , FTP, FTPS, SCP, SFTP, TELNET, LDAP, LDAPS, DICT, FILE, TFTP.

    BTW. SFTP is not to be confused with FTPS. SFTP is SSH File Transfer Protocol, while FTPS is FTP over SSL.

提交回复
热议问题