1CURLOPT_UPLOAD_BUFFERSIZE(3)curl_easy_setopt optionsCURLOPT_UPLOAD_BUFFERSIZE(3)
2
3
4

NAME

6       CURLOPT_UPLOAD_BUFFERSIZE - upload buffer size
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UPLOAD_BUFFERSIZE, long
12       size);
13

DESCRIPTION

15       Pass a long specifying your preferred size (in bytes)  for  the  upload
16       buffer  in  libcurl.  It  makes  libcurl uses a larger buffer that gets
17       passed to the next layer in the stack to get sent off. In  some  setups
18       and  for some protocols, there's a huge performance benefit of having a
19       larger upload buffer.
20
21       This is just treated as a request, not an order. You cannot be  guaranā€
22       teed to actually get the given size.
23
24       The  upload  buffer size is by default 64 kilobytes. The maximum buffer
25       size allowed to be set is 2 megabytes. The minimum buffer size  allowed
26       to be set is 16 kilobytes.
27
28       Since  curl 7.61.1 the upload buffer is allocated on-demand - so if the
29       handle isn't used for upload, this buffer will not be allocated at all.
30
31       DO NOT set this option on a handle that is currently used for an active
32       transfer as that may lead to unintended consequences.
33

DEFAULT

35       64 kB
36

PROTOCOLS

38       All
39

EXAMPLE

41       CURL *curl = curl_easy_init();
42       if(curl) {
43         curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com/foo.bin");
44
45         /* ask libcurl to allocate a larger upload buffer */
46         curl_easy_setopt(curl, CURLOPT_UPLOAD_BUFFERSIZE, 120000L);
47
48         ret = curl_easy_perform(curl);
49
50         curl_easy_cleanup(curl);
51       }
52

AVAILABILITY

54       Added in 7.62.0.
55

RETURN VALUE

57       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
58       if not.
59

SEE ALSO

61       CURLOPT_BUFFERSIZE(3), CURLOPT_READFUNCTION(3),
62
63
64
65libcurl 7.79.1                September 08, 2021  CURLOPT_UPLOAD_BUFFERSIZE(3)
Impressum