cURL / Mailing Lists / curl-library / Single Mail


Re: Issue with <CR> being appended in a FTP transfer

From: Daniel Stenberg <>
Date: Mon, 3 Feb 2003 09:48:27 +0100 (CET)

On Mon, 3 Feb 2003, Uday Singh wrote:

> I am trying to get a file from a FTP location.
> I use the curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "RETR <file-name>");

Uh, why do you set this? RETR is the normal download command.

> The file I get back has carriage return (\r). I would ideally like to get
> the file as-is without any modification.

Has carriage return where? In the contents? And you say the original file on
the server doesn't have this?

> I tried setting the mode to ASCII (CURLOPT_TRANFERTEXT set to non-null).
> That didn't fix it.

That tells the server to send it as ASCII, and it could affect newline
translations etc, sure.

> I tried calling "TYPE I" (to set the mode to binary) through the curl_slist
> using the CURLOPT_PREQUOTE option. That didn't seem to makea difference.

libcurl uses TYPE I by default unless you set it to do ASCII.

> Is there something obvious that I am missing? Any advice you may have to
> offer will be great.

I don't understand what you're trying to do. libcurl gets the file using the
FTP protocol. I think you're trying to do some translations of file contents
that the FTP protocol doesn't do automaticly for you.

 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
Received on 2003-02-03