CURL.SetOptionQuote
-------------------

Sets the list of FTP or SFTP commands to pass to the server prior to your FTP request.

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

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

**MBS**( **"CURL.SetOptionQuote";** /\* Sets the list of FTP or SFTP commands to pass to the server prior to your FTP request. \*/  
**$curl**; /\* The CURL session handle. \*/   
**$Value...**) /\* The ftp commands.e.g. "mkdir testfolder" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| curl | The CURL session handle. | $curl |
| Value... | The ftp commands. | "mkdir testfolder" |

### Result

Returns "OK" on success.

### Description

Sets the list of FTP or SFTP commands to pass to the server prior to your FTP request.   
This will be done before any other commands are issued (even before the CWD command for FTP). Disable this operation again by passing no value to this function. When speaking to a FTP (or SFTP) server, prefix the command with an asterisk (\*) to make libCURL continue even if the command fails as by default libCURL will stop at first failure.  
  
The set of valid FTP commands depends on the server (see RFC 959 for a list of mandatory commands).  
  
The valid SFTP commands are: chgrp, chmod, chown, ln, mkdir, pwd, rename, rm, rmdir, symlink.  
Paths can have quotes for spaces. Use either double or single quotes.  
  
This option takes a list of items. So this function takes a variable number of arguments. If you call function with 2 parameters, you set an empty list. If you call it with 5 parameters, you set a list with 3 values.  
  
See also [CURL.SetOptionPreQuote](CURLSetOptionPreQuote.md) and [CURL.SetOptionPostQuote](CURLSetOptionPostQuote.md).  
  
Here is list of raw FTP commands:  
[http://en.wikipedia.org/wiki/List\_of\_FTP\_commands](http://en.wikipedia.org/wiki/List_of_FTP_commands)  
  
File names may be passed with quotes to include spaces in file names.  
  
On SFTP you can use "pwd" command to print current full path and discover what ~ may mean for the home path. For the "rm" command to delete files with SFTP, you need a path which can't include "~" to reference the home folder.  
  
This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.  
Please repeat Value parameter as often as you need.  
See also [QUOTE](https://curl.haxx.se/libcurl/c/CURLOPT_QUOTE.html) option in CURL manual.

### Examples

Delete file only with FTP:

 MBS ( "CURL.SetOptionQuote"; $curl ; "DELE test.txt" )  
Delete folder:

 MBS ( "CURL.SetOptionQuote"; $curl ; "RMD testfolder" )  
Create folder with FTP:

 MBS ( "CURL.SetOptionQuote"; $curl ; "MKD testfolder" )  
Rename file using two FTP commands:

 MBS ( "CURL.SetOptionQuote" ; $curl ; "RNFR foo.txt"; "RNTO bar.txt" )  
Set file permissions for FTP:

 MBS ( "CURL.SetOptionQuote" ; $curl ; "SITE CHMOD 777 testfile")  
Call with three parameters:

 MBS ( "CURL.SetOptionQuote"; handle; $value1 ; $value2 ; $value3 )  
List all files:

 MBS ( "CURL.SetOptionQuote" ; $curl ; "NLST -all" )  
Connect to FTP server and delete a file:

 Set Variable \[$curl ; Value:MBS ("[CURL.New](CURLNew.md)")\]  
\#this is URL to ftp server   
Set Variable \[$r ; Value:MBS ("[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; "ftp://www.monkeybreadsoftware.com/")\]  
\# set user name   
Set Variable \[$r ; Value:MBS ("[CURL.SetOptionUserName](CURLSetOptionUserName.md)"; $curl ; "xxx")\]  
\# set password   
Set Variable \[$r ; Value:MBS ("[CURL.SetOptionPassword](CURLSetOptionPassword.md)"; $curl ; "xxx")\]  
\# set delete command of file "test.jpg" in folder "images"   
Set Variable \[$r ; Value:MBS ("CURL.SetOptionQuote"; $curl ; "DELE images/test.jpg")\]  
\#run transfer   
Set Field \[CURL Test::Result ; MBS ("[CURL.Perform](CURLPerform.md)"; $curl )\]  
\#get debug messages   
Set Field \[CURL Test::debug ; MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl )\]  
Set Variable \[$result ; Value:MBS ("[CURL.Release](CURLRelease.md)"; $curl )\]  
Move file on SFTP in done folder with variables and quotes:

 MBS ("CURL.SetOptionQuote"; $curl ;   
// first delete   
"rm " &amp; "\\"" &amp; $Path &amp; $folder &amp; "Done/" &amp; $$FileName &amp; "\\"";  
// then move  
"rename " &amp; "\\"" &amp; $Path &amp; $folder &amp; "/" &amp; $$FileName &amp; "\\"" &amp; " " &amp; "\\"" &amp; $Path &amp; $folder &amp; "Done/" &amp; $$FileName &amp; "\\"")  
Change file permissions via SFTP:

 # set permissions to 777, so everyone can read/write/execute the file.   
Set Variable \[ $result ; Value: MBS ( "CURL.SetOptionQuote"; $curl ; "chmod 777 /Users/cs/Pictures/test.jpg" ) \]  
Change file owner group via SFTP:

 # change group to group 20   
Set Variable \[ $result ; Value: MBS ( "CURL.SetOptionQuote"; $curl ; "chgrp 20 /Users/cs/Pictures/test.jpg" ) \]  
Change file owner via SFTP:

 # change owner to user 501   
Set Variable \[ $result ; Value: MBS ( "CURL.SetOptionQuote"; $curl ; "chown 501 /Users/cs/Pictures/test.jpg" ) \]  
Rename file after upload for SFTP:

 Set Variable \[ $curl ; Value: MBS ("[CURL.New](CURLNew.md)") \]   
Set Variable \[ $result ; Value: MBS ( "[CURL.SetOptionURL](CURLSetOptionURL.md)"; $curl ; "sftp://test.com/folder/temp.jpg") \]   
\# credentials   
Set Variable \[ $result ; Value: MBS ( "[CURL.SetOptionPassword](CURLSetOptionPassword.md)"; $curl ; CURL Test::Password ) \]   
Set Variable \[ $result ; Value: MBS ( "[CURL.SetOptionUserName](CURLSetOptionUserName.md)"; $curl ; CURL Test::Name ) \]   
Set Variable \[ $result ; Value: MBS ( "[CURL.SetOptionSSHAuthTypes](CURLSetOptionSSHAuthTypes.md)"; $curl ; 2+8 ) \]   
\# data to upload from container field   
Set Variable \[ $result ; Value: MBS ("[CURL.SetOptionUpload](CURLSetOptionUpload.md)"; $curl ; 1) \]   
Set Variable \[ $result ; Value: MBS ("[CURL.SetInputFile](CURLSetInputFile.md)"; $curl ; CURL Test::Image ) \]   
Set Variable \[ $result ; Value: MBS ("[CURL.SetInputFile](CURLSetInputFile.md)"; $curl ; CURL Test::Image ) \]   
\# Require TLS 1.2 for FTP over SSL:   
Set Variable \[ $result ; Value: MBS ( "[CURL.SetOptionUseSSL](CURLSetOptionUseSSL.md)"; $curl ; 3 ) \]   
Set Variable \[ $result ; Value: MBS ( "[CURL.SetOptionSSLVersion](CURLSetOptionSSLVersion.md)"; $curl ; 6 ) \]   
\# download existing file, rename after upload   
Set Variable \[ $result ; Value: MBS ( "[CURL.SetOptionPostQuote](CURLSetOptionPostQuote.md)"; $curl ; "\*rm image.jpg"; "rename temp.jpg image.jpg" ) \]   
\# see progress in debug messages   
Set Variable \[ $result ; Value: MBS ( "[CURL.SetDebugWithProgress](CURLSetDebugWithProgress.md)"; $curl ; 1 ) \]   
\# perform it   
Set Field \[ CURL Test::Result ; MBS ("[CURL.Perform](CURLPerform.md)"; $curl ) \]   
Set Field \[ CURL Test::debug ; MBS ("[CURL.GetDebugMessages](CURLGetDebugMessages.md)"; $curl ) \]   
Set Variable \[ $result ; Value: MBS ("[CURL.Release](CURLRelease.md)"; $curl ) \]  
Create folder with SFTP:

 MBS ( "CURL.SetOptionQuote"; $curl ; "mkdir 'Backups/today'" )  
### See also

- [CURL.GetOptionQuote](CURLGetOptionQuote.md)
- [CURL.SetOptionPostQuote](CURLSetOptionPostQuote.md)
- [CURL.SetOptionPreQuote](CURLSetOptionPreQuote.md)
- [CURL.SetOptionPut](CURLSetOptionPut.md)
- [CURL.SetOptionRange](CURLSetOptionRange.md)
- [CURL.SetOptionSSHAuthTypes](CURLSetOptionSSHAuthTypes.md)
- [CURL.SetOptionSSLVersion](CURLSetOptionSSLVersion.md)
- [CURL.SetOptionUpload](CURLSetOptionUpload.md)
- [CURL.SetOptionURL](CURLSetOptionURL.md)
- [CURL.SetOptionVerbose](CURLSetOptionVerbose.md)

### Example Databases

- [CURL/FTP/CURL FTP Delete File](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/FTP/CURL%20FTP%20Delete%20File.shtml#2ScriptAnchor_)
- [CURL/SFTP/CURL sFTP Operations](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/SFTP/CURL%20sFTP%20Operations.shtml#6ScriptAnchor_)

### 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)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)

Created 18th August 2014 , last changed 19th November 2025

  
[CURL.SetOptionQuickExit](CURLSetOptionQuickExit.md) - [CURL.SetOptionRTSPClientCSEQ](CURLSetOptionRTSPClientCSEQ.md)

[HTML Version](CURLSetOptionQuote.shtml)