cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Facing an issue while doing FTP download for large file size:

From: Alex Bligh <alex_at_alex.org.uk>
Date: Thu, 17 Mar 2011 14:03:46 +0000

Lakshmi,

--On 17 March 2011 18:55:24 +0530 lakshmi <lakshmi_at_dikshatech.com> wrote:

> Actually i have even tried passing the exact file size to curl API but
> din't work !

I would suggest you just omit the line.

Also, can I suggest you look at the "--libcurl" option of the
curl command line tool.

> --libcurl <file>
> Append this option to any ordinary curl command line, and
> you will get a libcurl-using source code written to the
> file that does the equivalent of what your command-line operation does!

curl will write the source code for you.

Alex

>
>
> Alex Bligh wrote:
>>
>>
>> --On 17 March 2011 18:10:53 +0530 lakshmi <lakshmi_at_dikshatech.com> wrote:
>>
>>> I am trying to do FTP download using the curl API "CURLOPT_MAXFILESIZE"
>>> for a file which is of 400MB !
>>
>> The curl library list is here:
>> http://cool.haxx.se/mailman/listinfo/curl-library
>>
>>> Curl API is:
>>> curl_easy_setopt(curlHandle_m, CURLOPT_MAXFILESIZE, 3L);
>>>
>>> The following error occurs and the file doesn't get downloaded: "63
>>> Maximum file size exceeded"
>>
>>
>>> From the man page:
>>
>>> CURLOPT_MAXFILESIZE
>>>
>>> Pass a long as parameter. This allows you to specify the maximum size
>>> (in
>>> bytes) of a file to download. If the file requested is larger than this
>>> value, the transfer will not start and CURLE_FILESIZE_EXCEEDED will be
>>> returned.
>>>
>>> The file size is not always known prior to download, and for such files
>>> this option has no effect even if the file transfer ends up being larger
>>> than this given limit. This concerns both FTP and HTTP transfers.
>>
>> You are setting the maximum file size to 3 bytes. Is that really what
>> you intended? 400MB > 3 bytes.
>>
>
>

-- 
Alex Bligh
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-17