cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Deleting remote file problem

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 3 Dec 2002 17:47:22 +0100 (MET)

On Tue, 3 Dec 2002, Nilesh Simaria wrote:

> I try to delete a remote file using libcurl. But insted of deleting a file,
> it just displays the contents of a file.
>
> curl_easy_setopt(curl, CURLOPT_URL, "ftp://192.168.1.5/a.txt");
> curl_easy_setopt(curl, CURLOPT_USERPWD, "usr:pwd");
> curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");

When doing FTP, libcurl only uses the optional CURLOPT_CUSTOMREQUEST instead
of the command that lists a directory.

You can't replace the RETR command with something as trivial as DELE as that
would confuse the download mechanism pretty much.

Instead, I'd suggest you try using CURLOPT_QUOTE, CURLOPT_PREQUOTE or
CURLOPT_POSTQUOTE.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET 
comprehensive development tool, built to increase your 
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
Received on 2002-12-03