CURL.SetOptionBufferSize
------------------------

Sets the buffer size.

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

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

**MBS**( **"CURL.SetOptionBufferSize";** /\* Sets the buffer size. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**) /\* The buffer size.e.g. 50000 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Value | The buffer size. | 50000 |

### Result

Returns "OK" on success.

### Description

Sets the buffer size.  
Pass a number specifying your preferred size (in bytes) for the receive buffer in libcurl. The main point of this would be that the write callback gets called more often and with smaller chunks. This is just treated as a request, not an order. You cannot be guaranteed to actually get the given size.  
  
This buffer size is by default CURL\_MAX\_WRITE\_SIZE (16kB). The maximum buffer size allowed to be set is CURL\_MAX\_READ\_SIZE (512kB). The minimum buffer size allowed to be set is 1024.  
  
For slow upload/downloads, it may be better to set buffer size to 1 MB with [CURL.SetOptionUploadBufferSize](CURLSetOptionUploadBufferSize.md) or CURL.SetOptionBufferSize properties to make transfers faster.  
See also [BUFFERSIZE](https://curl.haxx.se/libcurl/c/CURLOPT_BUFFERSIZE.html) option in CURL manual.

### Examples

Sets buffer size:

 MBS ( "CURL.SetOptionBufferSize"; $curl ; 1024\*1024 )  
### See also

- [CURL.SetOptionInFileSize](CURLSetOptionInFileSize.md)
- [CURL.SetOptionMaxFileSize](CURLSetOptionMaxFileSize.md)
- [CURL.SetOptionSSLVersion](CURLSetOptionSSLVersion.md)
- [CURL.SetOptionUpload](CURLSetOptionUpload.md)
- [CURL.SetOptionUploadBufferSize](CURLSetOptionUploadBufferSize.md)

### Example Databases

- [CURL/SFTP/CURL sFTP Upload File](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/SFTP/CURL%20sFTP%20Upload%20File.shtml#7ScriptAnchor_)

Created 18th August 2014 , last changed 3th October 2019

  
[CURL.SetOptionAutoReferer](CURLSetOptionAutoReferer.md) - [CURL.SetOptionCACacheTimeout](CURLSetOptionCACacheTimeout.md)

[HTML Version](CURLSetOptionBufferSize.shtml)