Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.SetOptionUploadFlags

Which flags to send the server relating to uploaded files.

Component Version macOS Windows Linux Server iOS SDK
CURL 15.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetOptionUploadFlags"; curl; Value )   More

Parameters

Parameter Description Example
curl The CURL session handle. $curl
Value The new setting. 1+16

Result

Returns OK or error.

Description

Which flags to send the server relating to uploaded files.
The current supported flags are a combination of these values:

NameValueDescription
Answered1Sets the Answered flag for IMAP uploads
Deleted2Sets the Deleted flag for IMAP uploads
Draft4Sets the Draft flag for IMAP uploads
Flagged8Sets the Flagged flag for IMAP uploads
Seen16Sets the Seen flag for IMAP uploads

See also UPLOAD_FLAGS option in CURL manual.

Examples

Set seen flag:

Set Variable [ $r; Value: MBS( "CURL.SetOptionUploadFlags"; $curl; 16 )]

Upload email to the Sent folder:

# Upload Email to Sent folder in file IMAP Email Upload

Set Variable [ $curl ; Value: MBS("CURL.New") ]
# Set URL with name of the mailbox included:
Set Variable [ $result ; Value: MBS("CURL.SetOptionURL"; $curl; CURL Test::URL & "/INBOX.Sent") ]
# We upload
Set Variable [ $result ; Value: MBS("CURL.SetOptionUpload"; $curl; 1) ]
# Pass the email to sent with CRLF emails
Set Variable [ $email ; Value: MBS("Text.ReplaceNewLine"; CURL Test::email; 3) ]
Set Variable [ $result ; Value: MBS("CURL.SetInputText"; $curl; $email; "UTF-8") ]
# login via username and password
Set Variable [ $result ; Value: MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionUserName"; $curl; CURL Test::Name) ]
# or if you have a token for gmail or office365 instead of a password
// Set Variable [ $r ; Value: MBS("CURL.SetOptionXOAuth2Bearer"; $curl; CURL Test::Password) ]
# Maybe use alternative IMAP port?
// Set Variable [ $r ; Value: MBS("CURL.SetOptionPort"; $curl; 143) ]
# This turns TLS on and requires connection to be encrypted
Set Variable [ $r ; Value: MBS("CURL.SetOptionUseSSL"; $curl; 3) ]
# force TLS v1.2
Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVersion"; $curl; 6) ]
# This disables certificate verification, so we accept any:
Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVerifyHost"; $curl; 0) ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVerifyPeer"; $curl; 0) ]
# Better with certificates if you have some:
// Set Variable [ $r ; Value: MBS( "CURL.SetOptionCAInfo"; $curl; "/Library/FileMaker Server/certificates.pem") ]
// Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVerifyHost"; $curl; 2) ]
// Set Variable [ $r ; Value: MBS("CURL.SetOptionSSLVerifyPeer"; $curl; 1) ]
# set flags for email like deleted, draft, seen and others
Set Variable [ $result ; Value: MBS("CURL.SetOptionUploadFlags"; $curl; 16) // seen flag ]
# do it!
Set Field [ CURL Test::Result ; MBS("CURL.Perform"; $curl) ]
# Check result:
Set Field [ CURL Test::debug ; MBS("CURL.GetDebugMessages"; $curl) ]
Set Variable [ $result ; Value: MBS("CURL.Release"; $curl) ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 13th April 2025, last changed 16th June 2025


CURL.SetOptionUploadBufferSize - CURL.SetOptionUseSSL