cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Posting large files

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 26 Sep 2009 23:28:53 +0200 (CEST)

On Fri, 25 Sep 2009, Gross, Tim (Utility Computing Architect) wrote:

>> http://curl.haxx.se/libcurl/c/post-callback.html

> Thanks for the pointer to this sample program. I have one question about
> setting the CURLOPT_POSTFIELDSIZE_LARGE option, which I think is preferable
> if I am posting the contents of a large file.

Either that, or set the chunked encoding header.

> Should the parameter
> curl_easy_setopt() be the size of the data transferred with each call to the
> read_callback function, or the total size?

The total.

> If I am reading in the content from a file, maybe this should be the size of
> the file.

It should be the total size you're going to POST.

> I am not sure what effect setting the CURLOPT_POSTFIELDSIZE_LARGE really
> has. I have read the documentation, but it is not clear. Does this set the
> maximum number of bytes to transfer.

It tells the server (and libcurl) how many bytes you're about to transfer.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-09-26