How to create a directory with cUrl, ssl?

Creating a secure FTP server in php. I have the following:

curl_setopt(self::$FTP, CURLOPT_URL, "ftp://".$user.":".$pass."@".$host); curl_setopt(self::$FTP, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt(self::$FTP, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt(self::$FTP, CURLOPT_FTP_SSL, CURLFTPSSL_TRY); curl_setopt(self::$FTP, CURLOPT_FTPLISTONLY, TRUE); curl_setopt(self::$FTP, CURLOPT_RETURNTRANSFER, 0); curl_exec(self::$FTP); 

this is normal. How to create directories?

+4
source share
1 answer

You can pass:

CURLOPT_FTP_CREATE_MISSING_DIRS as TRUE

to create missing directories when an FTP operation encounters a path that does not currently exist.

You can read this in the documentation: PHP curl_setopt

+5
source

Source: https://habr.com/ru/post/1415803/


All Articles