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:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
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 | 2.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
curl | The CURL session handle. | $curl |
Value... | The ftp commands. | "mkdir testfolder" |
Returns "OK" on success.
See also QUOTE option in CURL manual.
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")]
#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" ) ]
Created 18th August 2014, last changed 5th June 2021
CURL.SetOptionPut - CURL.SetOptionRTSPClientCSEQ
Feedback: Report problem or ask question.