Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.SetOptionUploadBufferSize

Set preferred upload buffer size.

Component Version macOS Windows Linux Server iOS SDK
CURL 8.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionUploadBufferSize"; curl; Value )   More

Parameters

Parameter Description Example
curl The CURL session handle. $curl
Value The new buffer size.

Result

Returns OK or error.

Description

Set preferred upload buffer size.
Pass an integer specifying your preferred size (in bytes) for the upload buffer in libcurl. It makes libcurl uses a larger buffer that gets passed to the next layer in the stack to get sent off. In some setups and for some protocols, there's a huge performance benefit of having a larger upload buffer.

This is just treated as a request, not an order. You cannot be guaranteed to actually get the given size.

The upload buffer size is by default 64 kilobytes. The maximum buffer size allowed to be set is 2 megabytes. The minimum buffer size allowed to be set is 16 kilobytes.

Since curl 7.61.1 the upload buffer is allocated on-demand - so if the handle isn't used for upload, this buffer will not be allocated at all.

For slow upload/downloads, it may be better to set buffer size to 1 MB with CURL.SetOptionUploadBufferSize or CURL.SetOptionBufferSize properties to make transfers faster.

See also UPLOAD_BUFFERSIZE option in CURL manual.

See also

Release notes

Blog Entries

Created 31st October 2018, last changed 3th October 2019


CURL.SetOptionUpload - CURL.SetOptionUseSSL