CURL.SetOptionMaxFileSize
-------------------------

Sets the maximum file size for download.

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

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

**MBS**( **"CURL.SetOptionMaxFileSize";** /\* Sets the maximum file size for download. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**) /\* The new maximum file size.e.g. 1000000 \*/ 

(old name: CURL.SetOptionMaxFileSizeLarge)

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Value | The new maximum file size. | 1000000 |

### Result

Returns "OK" on success.

### Description

Sets the maximum file size for download.  
Pass a number as parameter. This allows you to specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and CURLE\_FILESIZE\_EXCEEDED will be returned.  
  
The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers.  
See also [MAXFILESIZE](https://curl.haxx.se/libcurl/c/CURLOPT_MAXFILESIZE.html) option in CURL manual.

### See also

- [CURL.SetOptionBufferSize](CURLSetOptionBufferSize.md)
- [CURL.SetOptionCookieFile](CURLSetOptionCookieFile.md)
- [CURL.SetOptionFileTime](CURLSetOptionFileTime.md)
- [CURL.SetOptionInFileSize](CURLSetOptionInFileSize.md)
- [CURL.SetOptionMaxAgeConn](CURLSetOptionMaxAgeConn.md)
- [CURL.SetOptionMaxRecvSpeed](CURLSetOptionMaxRecvSpeed.md)
- [CURL.SetOptionMaxRedirs](CURLSetOptionMaxRedirs.md)
- [CURL.SetOptionMaxSendSpeed](CURLSetOptionMaxSendSpeed.md)
- [CURL.SetOptionPostFieldSize](CURLSetOptionPostFieldSize.md)

### Blog Entries

- [Translating Insert from URL options for CURL to MBS Plugin calls](https://www.mbsplugins.de/archive/2020-12-14/Translating_Insert_from_URL_op/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.3pr1](https://www.mbsplugins.de/archive/2013-05-24/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

Created 18th August 2014 , last changed 18th April 2016

  
[CURL.SetOptionMaxConnects](CURLSetOptionMaxConnects.md) - [CURL.SetOptionMaxLifeTimeConnection](CURLSetOptionMaxLifeTimeConnection.md)

[HTML Version](CURLSetOptionMaxFileSize.shtml)