Im creating secure FTP manager on 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);
its ok. Now how to create directories?
You can pass the:
CURLOPT_FTP_CREATE_MISSING_DIRSasTRUEto create missing directories when an FTP operation encounters a path that currently doesn’t exist.
You can read this on the documentation: PHP curl_setopt