FTP
The FTP module allows you perform various operations against an FTP or SFTP server.
Attributes
Here is the list of available attributes you can use.
action
string
The ftp operation you want to perform. Use Values: * open * close * changeDir * createDir * listDir * removeDir * getFile * putFile * rename * remove * getCurrentDir * existsDir * existsFile
username
string
The username to log in with.
password
string
The password to log in with.
server
string
The FTP server to connect with. Ex. ftp.server.com
timeout
numeric
Number of seconds for the timeout of all operations. This includes data request operations. Defaults to 0, which indicates no timeout.
port
numeric
The FTP server port. Defaults to port 21.
connection
string
The variable name and reference for an FTP connection. This is required for all bx-ftp commands.
stopOnError
boolean
Set to true to halt execution if an FTP error occurs. Defaults to false.
passive
boolean
Set to true to enable passive mode. Only available for FTP connections, not SFTP.
directory
string
Directory on which operation to perform. Used for actions listDir, changeDir, and existsDir.
localFile
string
Name of file on local system. Used in actions getFile and putFile.
remoteFile
string
Name of file on the FTP server. Used in actions existsFile, getFile, and putFile.
item
string
Name of file or directory. Used in actions remove, and removeDir.
open
putfile
removeDir
remove
Examples
Open FTP Connection
Open SFTP Connection
To connect using SFTP, you need to set secure
equal to true
.
Close Connection
Last updated
Was this helpful?