I continue my hard expedition in CurLand, without succes i have test with "DELE", "RMD", RMDA", "DELETE"
This time, i want delete a file
Curl wrote:Error: Quote command returned error
Code: Select all
#REMOTE_FILE = "libcurl.pbi"
#URL$ = "sftp://MyFtpServer.fr/var/www/html/" + #REMOTE_FILE
#Username$ = "XXXX"
#Password$ = "XXXXX"
#LibCurl_ExternalDLL = #True
IncludeFile "libcurl.pbi"
Define curl.i, res.i, *headerlist
InitNetwork()
curl_global_init(#CURL_GLOBAL_DEFAULT)
curl = curl_easy_init()
If curl
*headerlist = curl_slist_append(*headerlist, "DELETE " + #REMOTE_FILE)
curl_easy_setopt(curl, #CURLOPT_WRITEFUNCTION, @LibCurl_WriteFunction())
curl_easy_setopt_str(curl, #CURLOPT_URL, #URL$)
curl_easy_setopt_str(curl, #CURLOPT_USERNAME, #Username$)
curl_easy_setopt_str(curl, #CURLOPT_PASSWORD, #Password$)
curl_easy_setopt(curl, #CURLOPT_POSTQUOTE, *headerlist)
curl_easy_setopt(curl, #CURLOPT_USE_SSL, #CURLUSESSL_ALL)
; accept insecure certificates
curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYPEER, #False)
curl_easy_setopt(curl, #CURLOPT_SSL_VERIFYHOST, #False)
res = curl_easy_perform(curl)
If res = #CURLE_OK
Debug "Ok"
Else
Debug "Error: " + curl_easy_strerror(res)
EndIf
curl_slist_free_all(*headerlist)
curl_easy_cleanup(curl)
curl_global_cleanup()
EndIf





