cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems with CURLOPT_CRLF

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sun, 5 Oct 2008 19:07:56 -0700

On Sun, Oct 05, 2008 at 06:46:31PM -0300, Carlos Alloatti wrote:
> I have not been able to get CURLOPT_CRLF to work, I guess I must be
> doing something wrong. The only code I have is a libcurl wrapper class
> for Visual FoxPro, so I will describe what I am doing.
>
> Purpose: download a text file from a server, convert LF to CRLF
>
> CURLOPT_SSL_VERIFYHOST = 0
> CURLOPT_SSL_VERIFYPEER = 0
> CURLOPT_USE_SSL = CURLUSESSL_TRY
> CURLOPT_VERBOSE = 1
> CURLOPT_WRITEFUNCTION = writefunc
> CURLOPT_WRITEDATA = filehandle
>
> CURLOPT_CRLF = 1
> CURLOPT_TRANSFERTEXT = 1
> CURLOPT_URL = ftp://test:test@ftp.secureftp-test.com/hamlet.xml
>
> the writefunc just saves the data using the Windows WriteFile Api function
>
> Using libcurl libcurl/7.19.0 OpenSSL/0.9.8h zlib/1.2.3 from
> http://www.gknw.net/mirror/curl/win32/curl-7.19.0-ssl-sspi-zlib-static-bin-w32.zip
>
> It seems CURLOPT_CRLF has no effect, the downloaded file only has LFs, no CRLFs.
>
> Any comments?

The remote server has to support CURLOPT_TRANSFERTEXT for this to work
on downloads, and it doesn't seem to be widely supported. It looks like
CURLOPT_CRLF actually only works on uploads. Maybe that could be documented
better.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-10-06