Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

CURL.SetOptionQuote

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

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 2.5 Yes Yes Yes Yes Yes

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

Parameters

Parameter Description Example value
Handle 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.

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:

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.Cleanup"; $curl)]

Move file on SFTP in done folder with variables and quotes:

MBS("CURL.SetOptionQuote"; $curl; "rename " & "\"" & $Path & $folder & "/" & $$FileName & "\"" & " " & "\"" & $Path & $folder & "Done/"
& $$FileName & "\"")

See also

Example Databases


CURL.SetOptionPut   -   CURL.SetOptionRandomFile

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins