5

Due to security reason my host doesn't support FTP plain text login, so they have suggested me to use ftpes protocol to connect the server. Based on this I have created a script but I am getting "Protocol FTPES not supported or disabled in libcurlFile upload error" error.

$options = array(
      CURLOPT_CONNECTTIMEOUT => 25,//waiting time, in seconds
      CURLOPT_PORT => FTP_PORT,
      CURLOPT_URL =>'FTPES://'.FTP_HOST.'/'.FTP_FILENAME,
      CURLOPT_USERPWD => FTP_USER.':'.FTP_PASS,
      CURLOPT_UPLOAD => 1,
      CURLOPT_INFILE => $fp,
      CURLOPT_INFILESIZE => filesize($meta['uri']),
      CURLOPT_TRANSFERTEXT => true,
      );

Can somebody help?

Kenster
  • 23,465
  • 21
  • 80
  • 106
Techiescorner
  • 791
  • 2
  • 12
  • 25

1 Answers1

0

Try setting it:

$options = array(
     ...
     CURLOPT_USE_SSL    => CURLUSESSL_TRY,
     CURLOPT_FTPSSLAUTH => CURLFTPAUTH_TLS,
     ...
 );

See https://curl.haxx.se/libcurl/c/CURLOPT_FTPSSLAUTH.html

(I had the same problem at command line curl -T ... and solved it using it curl --ssl -T ...)

Adrian
  • 2,233
  • 1
  • 22
  • 33