Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
CURL.SetOptionUpload
Sets this transfer to be an upload.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CURL | 2.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "CURL.SetOptionUpload"; curl; Value ) More
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 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. With HTTP 1.0 or without chunked transfer, you must specify the size.
See also CURL.SetOptionPost.
If you like to make a PATCH or PUT, you can use either CURL.SetOptionPostFields + CURL.SetOptionCustomRequest or the combination of CURL.SetOptionUpload + CURL.SetInputText. It seems to be bad to use CURL.SetOptionPostFields and CURL.SetOptionUpload since CURL tries to upload, but hasn't got data.
See also UPLOAD option in CURL manual.
Examples
Set CURL session to be upload:
MBS( "CURL.SetOptionUpload"; $curl; 1 )
See also
- CURL.SetOptionAppend
- CURL.SetOptionNoBody
- CURL.SetOptionPort
- CURL.SetOptionPost
- CURL.SetOptionProxy
- CURL.SetOptionPut
- CURL.SetOptionSSHPrivateKeyfile
- CURL.SetOptionSSHPublicKeyfile
- CURL.SetOptionUploadBufferSize
- CURL.SetOptionUseSSL
Release notes
- Version 8.5
Example Databases
- CURL/Amazon S3/Amazon S3 Upload File
- CURL/CURL Custom Function
- CURL/CURL get and put/CURLS get and put
- CURL/Email/IMAP Email Upload
- CURL/FTP/CURL FTP Upload File
- CURL/FTP/CURL FTP Upload from file with Progress
- CURL/SFTP/CURL sFTP Operations
- CURL/SFTP/CURL sFTP Upload File
- CURL/WebServices/CURL FMS Admin API v17
- CURL/WebServices/Magento2 REST API
Blog Entries
- SFTP Upload with temporary file
- CURL Custom Function
- Translating Insert from URL options for CURL to MBS Plugin calls
- Upload email to Sent folder via IMAP
- Tip of the day: FTP File Upload
- CURL Tutorial for Filemaker with MBS Plugin
Created 18th August 2014, last changed 27th February 2023
CURL.SetOptionUpkeepIntervalMS - CURL.SetOptionUploadBufferSize