cURL / Mailing Lists / curl-library / Single Mail


Re: Does Libcurl support downloading payload in chunks to increase success rate?

From: Dan Fandrich <>
Date: Fri, 28 Feb 2014 00:20:43 +0100

On Fri, Feb 28, 2014 at 12:19:49AM +0800, Md Kashif wrote:
> How would application know if download of a chunk was successful or not. Is checking for the return value of curl_easy_perform() for each chunk enough?

No, you need to look at the application-level return code as well. You also
need to look at the returned headers, because some servers won't support
ranges and won't return an error code.

> Also, for resuming interrupted downloads which option would be the best CURLOPT_RESUME_FROM or CURLOPT_RANGE or is there any other option to do this?

You're right, the documentation isn't very clear on this point. IIUC,
CURLOPT_RESUME_FROM affects both ends of the transfer, while
CURLOPT_RANGE only specifies a range to the server.

>>> Dan
List admin:
Received on 2014-02-28