cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem downloading using text transfer mode

From: Abel Alonso <abelalon_at_gmail.com>
Date: Thu, 26 Jun 2008 13:15:11 +0200

I tried to download the file in ASCII with filezilla and the file is
download correctly. So I guess that the problem is only in the download
process and not in the upload, because the file in the server is correct.

2008/6/26 Abel Alonso <abelalon_at_gmail.com>:

> Opening files in text mode It still fails. The problem is that if I have
> this file:
>
> asdf
> as
>
> In windows its size is 8B because the line ending is CRLF and in Linux is
> 7B. When I upload that file it is stored in the server with a size of 7B,
> but when I download it again the size doesn't turn to 8B and I miss the last
> character.
>
>
> 2008/6/24 Abel Alonso <abelalon_at_gmail.com>:
>
>> Upsss... I'm opening the file in binary mode... I'm going to fix that and
>> I'll let you know if it works.
>>
>> 2008/6/24 Abel Alonso <abelalon_at_gmail.com>:
>>
>> Without it I have the same issue.
>>>
>>> 2008/6/24 Dan Fandrich <dan_at_coneharvesters.com>:
>>>
>>> On Tue, Jun 24, 2008 at 01:01:25PM +0200, Abel Alonso wrote:
>>>> > The code I use to upload and download files:
>>>> >
>>>> >
>>>> > //Download Code
>>>> >
>>>> > CURL *curl;
>>>> > curl = curl_easy_init();
>>>> >
>>>> > curl_easy_setopt( curl, CURLOPT_FTP_USE_EPSV, 0 );
>>>> >
>>>> > curl_easy_setopt(curl, CURLOPT_URL,);
>>>> >
>>>> > curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &fileWrite);
>>>> > curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);
>>>>
>>>> Are you opening this file in binary mode?
>>>>
>>>> > curl_easy_setopt( curl, CURLOPT_TRANSFERTEXT, 1 );
>>>> > curl_easy_setopt( curl, CURLOPT_CRLF, 1 );
>>>>
>>>> Hmmm, I don't think you want to set the CRLF option on a Windows system.
>>>>
>>>> >>> Dan
>>>> --
>>>> http://www.MoveAnnouncer.com The web change of address
>>>> service
>>>> Let webmasters know that your web site has moved
>>>>
>>>
>>>
>>
>
Received on 2008-06-26