I set up a transfer from an SFTP server. The file transfer is successful, but the deletion of the file from the SFTP server is rejected with the message "Permission denied". The code settings are as follows:
/*
m_urlStart : url
cmdlist : contient la liste des commandes
*/
struct curl_slist *cmdlist = curl_slist_append(nullptr, ("rm " + getPath().toStdString()).c_str());
if (cmdlist == nullptr) {
m_logFunct("Erreur lors de l'initialisation de la supression de fichier avec libcurl");
return;
}
curl_easy_setopt(m_curl, CURLOPT_URL, m_urlStart.toStdString().c_str());
curl_easy_setopt(m_curl, CURLOPT_POSTQUOTE, cmdlist);
if (curl_easy_perform(m_curl) != 0) {
m_logFunct(QString("Erreur curl : %1").arg(m_errorBuf));
}
curl_easy_setopt(m_curl, CURLOPT_POSTQUOTE, 0);
curl_slist_free_all(cmdlist);
I've tested with following options :
curl_easy_setopt(m_curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(m_curl, CURLOPT_SSL_VERIFYHOST, 0);
but I still get the message Permission denied.