CURL.SetOptionUploadBufferSize
------------------------------

Set preferred upload buffer size.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CURL](component_CURL.md) | [8.5](newinversion85.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "CURL.SetOptionUploadBufferSize"; curl; Value ) 

**MBS**( **"CURL.SetOptionUploadBufferSize";** /\* Set preferred upload buffer size. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**) /\* The new buffer size. \*/ 

### 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](CURLSetOptionBufferSize.md) properties to make transfers faster.  
See also [UPLOAD\_BUFFERSIZE](https://curl.haxx.se/libcurl/c/CURLOPT_UPLOAD_BUFFERSIZE.html) option in CURL manual.

### See also

- [CURL.SetOptionBufferSize](CURLSetOptionBufferSize.md)
- [CURL.SetOptionUpload](CURLSetOptionUpload.md)

### Release notes

- **Version 8.5**
    - Added [CURL.SetOptionDOHURL](http://www.mbsplugins.eu/CURLSetOptionDOHURL.shtml), [CURL.SetOptionUpkeepIntervalMS](http://www.mbsplugins.eu/CURLSetOptionUpkeepIntervalMS.shtml), [CURL.SetOptionUploadBufferSize](http://www.mbsplugins.eu/CURLSetOptionUploadBufferSize.shtml) and [CURL.Upkeep](http://www.mbsplugins.eu/CURLUpkeep.shtml).

### Blog Entries

- [MBS FileMaker Plugin, version 8.5pr5](https://www.mbsplugins.de/archive/2018-11-02/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

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

  
[CURL.SetOptionUpload](CURLSetOptionUpload.md) - [CURL.SetOptionUploadFlags](CURLSetOptionUploadFlags.md)

[HTML Version](CURLSetOptionUploadBufferSize.shtml)