Answer the question
In order to leave comments, you need to log in
How to create an empty FTP file using php-curl?
Is it possible to do this with curl? I ask because after analyzing the list of service ftp commands, I did not find the command to create a file (there are commands: create a directory (MKD), delete a directory (RMD) and a file (DELE))
I wanted to do it this way:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'ftp://' . $ftphost);
curl_setopt($ch, CURLOPT_USERPWD, $ftpuser.':'.$ftppassword);
curl_setopt($ch, CURLOPT_QUOTE, array('Команда создания файла ' . $dir . $name_file , 'QUIT'));
curl_exec($ch);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question