cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to delete file from sftp server by libcurl

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 25 Sep 2012 21:00:13 +0200

On Thu, Sep 20, 2012 at 11:29:00AM +0800, $B2+?4W^(B wrote:
> I am trying to delete a file from sftp server. Here is my code:
>
> CString cmd = "delete 2.key";
> CURL *curl = curl_easy_init();
> curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_PASSWORD);
> curl_easy_setopt(curl, CURLOPT_USERPWD, myUserPass.c_str());
> curl_easy_setopt(curl, CURLOPT_URL, myUrl.c_str());
> curl_easy_setopt(curl, CURLOPT_PORT, atoi(m_port.c_str()));
> curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, cmd.c_str());

CURLOPT_CUSTOMREQUEST is documented to be valid for HTTP, FTP or POP3
only. What you are looking for is CURLOPT_QUOTE or the PRE or POST
variant thereof.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-25