cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Re: Why CURLOPT_TRANSFERTEXT doesn't work while downloading file in FTP :(???

From: Ngo Hoa Lan Phuong <orchidanz_at_gmail.com>
Date: Fri, 12 Dec 2008 14:25:57 +0700

>
> *> I'm trying to download a file from a FTP server in binary mode. *
> *> I set CULROPT_TRANSFERTEXT = 0 and use option CURLOPT_WRITEFUNCTION to
> write *
> *> the data to the FILE *. *
> *> I even tried to use CURLOPT_PROXY_TRANSFER_MODE before setting *
> *> CURLOPT_TRANSFERTEXT (however I didn't using proxy for ftp transfer) *
> *> But anyway it came out that file's downloaded in ASCII mode. (TYPE = A)
> *
> *> Do you have any idea why this option doesn't work :(?? *
> Are you sure libcurl is sending TYPE A? Or did you forget to open the FILE*
>
> file in binary mode? Are you using a proxy? If so, I believe with recent
> version of libcurl you need to append ;type=B on to the URL.

Yeah, I'm sure libcurl is sending Type A, I'm using a DebugFunction and it
prints out that TYPE = A.
Besides, I downloaded a text file in Unix format and I received a file in
Window format (newline = CRLF)
The file's opened in binary mode and I don't use a proxy. Using *
CURLOPT_PROXY_TRANSFER_MODE* don't have any effect in my case.

You said about appending ;type=B to the URL, but how to set it through a
option? I can't find any document about it :(
Thanks for any help!
Phuong.Ngo
Received on 2008-12-12