Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
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 | FileMaker iOS SDK |
| CURL | 2.5 | Yes | Yes | Yes | Yes | Yes |
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.
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 and CURL.SetOptionPostQuote.
Here is list of raw FTP commands:
http://en.wikipedia.org/wiki/List_of_FTP_commands
File names may be passed with quotes to include spaces in file names.
See also QUOTE option in CURL manual.
Examples
Delete file only:
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")]
#this is URL to ftp server
Set Variable [$r; Value:MBS("CURL.SetOptionURL"; $curl; "ftp://www.monkeybreadsoftware.de/")]
# set user name
Set Variable [$r; Value:MBS("CURL.SetOptionUserName"; $curl; "xxx")]
# set password
Set Variable [$r; Value:MBS("CURL.SetOptionPassword"; $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"; $curl)]
#get debug messages
Set Field [CURL Test::debug; MBS("CURL.GetDebugAsText"; $curl)]
Set Variable [$result; Value:MBS("CURL.Release"; $curl)]
Move file on SFTP in done folder with variables and quotes:
MBS("CURL.SetOptionQuote"; $curl; "rename " & "\"" & $Path & $folder & "/" & $$FileName & "\"" & " " & "\"" & $Path & $folder & "Done/"
& $$FileName & "\"")
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" ) ]
See also
- CURL.SetOptionPassword
- CURL.SetOptionPost
- CURL.SetOptionPreQuote
- CURL.SetOptionProxy
- CURL.SetOptionPut
- CURL.SetOptionResolve
- CURL.SetOptionUpload
- CURL.SetOptionURL
- CURL.SetOptionUserName
- CURL.SetOptionVerbose
Example Databases
Blog Entries
Created 18th August 2014, last changed 19th April 2020
CURL.SetOptionPut - CURL.SetOptionRTSPClientCSEQ
Feedback: Report problem or ask question.
Links
MBS Xojo PDF Plugins