CURL.SetOptionUpload
--------------------

Sets this transfer to be an upload.

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

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

**MBS**( **"CURL.SetOptionUpload";** /\* Sets this transfer to be an upload. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value**) /\* Whether to do an upload.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Value | Whether to do an upload. | 1 |

### Result

Returns "OK" on success.

### Description

Sets this transfer to be an upload.  
A parameter set to 1 tells the library to prepare for an upload. With the CURL.SetInput functions you can define the upload data. If the protocol is HTTP, uploading means using the PUT request unless you tell curl otherwise.  
  
Using PUT with HTTP 1.1 implies the use of a "Expect: 100-continue" header. You can disable this header with [CURL.SetOptionHTTPHeader](CURLSetOptionHTTPHeader.md) as usual.  
  
If you use PUT to a HTTP 1.1 server, you can upload data without knowing the size before starting the transfer if you use chunked encoding. You enable this by adding a header like "Transfer-Encoding: chunked" with [CURL.SetOptionHTTPHeader](CURLSetOptionHTTPHeader.md). With HTTP 1.0 or without chunked transfer, you must specify the size.  
  
See also [CURL.SetOptionPost](CURLSetOptionPost.md).  
  
If you like to make a PATCH or PUT, you can use either [CURL.SetOptionPostFields](CURLSetOptionPostFields.md) + [CURL.SetOptionCustomRequest](CURLSetOptionCustomRequest.md) or the combination of CURL.SetOptionUpload + [CURL.SetInputText](CURLSetInputText.md). It seems to be bad to use [CURL.SetOptionPostFields](CURLSetOptionPostFields.md) and CURL.SetOptionUpload since CURL tries to upload, but hasn't got data.  
See also [UPLOAD](https://curl.haxx.se/libcurl/c/CURLOPT_UPLOAD.html) option in CURL manual.

### Examples

Set CURL session to be upload:

 MBS ( "CURL.SetOptionUpload"; $curl ; 1 )  
### See also

- [CURL.SetOptionAppend](CURLSetOptionAppend.md)
- [CURL.SetOptionNoBody](CURLSetOptionNoBody.md)
- [CURL.SetOptionPort](CURLSetOptionPort.md)
- [CURL.SetOptionPost](CURLSetOptionPost.md)
- [CURL.SetOptionProxy](CURLSetOptionProxy.md)
- [CURL.SetOptionQuote](CURLSetOptionQuote.md)
- [CURL.SetOptionSSHPrivateKeyfile](CURLSetOptionSSHPrivateKeyfile.md)
- [CURL.SetOptionSSHPublicKeyfile](CURLSetOptionSSHPublicKeyfile.md)
- [CURL.SetOptionUploadBufferSize](CURLSetOptionUploadBufferSize.md)
- [CURL.SetOptionUseSSL](CURLSetOptionUseSSL.md)

### Release notes

- **Version 15.2**
    - Added [CURL.SetOptionTCPKeepCount](https://www.mbsplugins.eu/CURLSetOptionTCPKeepCount.shtml) and [CURL.SetOptionUploadFlags](https://www.mbsplugins.eu/CURLSetOptionUploadFlags.shtml) functions.
- **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).

### Example Databases

- [CURL/Amazon S3/Amazon S3 Upload File](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Amazon%20S3/Amazon%20S3%20Upload%20File.shtml#9ScriptAnchor_)
- [CURL/CURL Custom Function](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20Custom%20Function.shtml#4CustomFunctionAnchor_)
- [CURL/CURL get and put/CURLS get and put](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/CURL%20get%20and%20put/CURLS%20get%20and%20put.shtml#1ScriptAnchor_)
- [CURL/Email/IMAP Email Upload](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/IMAP%20Email%20Upload.shtml#1ScriptAnchor_)
- [CURL/FTP/CURL FTP Upload File](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/FTP/CURL%20FTP%20Upload%20File.shtml#2ScriptAnchor_)
- [CURL/FTP/CURL FTP Upload from file with Progress](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/FTP/CURL%20FTP%20Upload%20from%20file%20with%20Progress.shtml#2ScriptAnchor_)
- [CURL/SFTP/CURL sFTP Operations](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/SFTP/CURL%20sFTP%20Operations.shtml#1ScriptAnchor_)
- [CURL/SFTP/CURL sFTP Upload File](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/SFTP/CURL%20sFTP%20Upload%20File.shtml#1ScriptAnchor_)
- [CURL/WebServices/CURL FMS Admin API v17](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/CURL%20FMS%20Admin%20API%20v17.shtml#12ScriptAnchor_)
- [CURL/WebServices/Magento2 REST API](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/WebServices/Magento2%20REST%20API.shtml#3ScriptAnchor_)

### Blog Entries

- [IMAP Upload Flags](https://www.mbsplugins.de/archive/2025-06-17/IMAP_Upload_Flags/monkeybreadsoftware_blog_filemaker)
- [SFTP Upload with temporary file](https://www.mbsplugins.de/archive/2023-03-06/SFTP_Upload_with_temporary_fil/monkeybreadsoftware_blog_filemaker)
- [CURL Custom Function](https://www.mbsplugins.de/archive/2022-12-12/CURL_Custom_Function/monkeybreadsoftware_blog_filemaker)
- [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)
- [Upload email to Sent folder via IMAP](https://www.mbsplugins.de/archive/2017-12-14/Upload_email_to_Sent_folder_vi/monkeybreadsoftware_blog_filemaker)
- [CURL Tutorial for Filemaker with MBS Plugin](https://www.mbsplugins.de/archive/2012-11-18/CURL_Tutorial_for_Filemaker_wi/monkeybreadsoftware_blog_filemaker)

Created 18th August 2014 , last changed 27th February 2023

  
[CURL.SetOptionUpkeepIntervalMS](CURLSetOptionUpkeepIntervalMS.md) - [CURL.SetOptionUploadBufferSize](CURLSetOptionUploadBufferSize.md)

[HTML Version](CURLSetOptionUpload.shtml)