Abort

Abort a file transfer in progress

Close

Close connection to the server unilaterally

Connect

Connect to FTP server

Arguments

Argument Type Default value Description
host straddress of the server
port int 21port of the server, defaults to 21
user str Nonelogin name, defaults to None
password str Nonelogin password, defaults to None
tls bool Falseconnect using TLS support, defaults to False
transfer str passivemode of the transfer, defaults to "passive"
param host:address of the server
param port:port of the server, defaults to 21
param user:login name, defaults to None
param password:login password, defaults to None
param tls:connect using TLS support, defaults to False
param transfer:mode of the transfer, defaults to "passive"
raises AuthenticationException:
 on authentication error with the server

Cwd

Change working directory on the server

Arguments

Argument Type Default value Description
dirname strname of the directory
param dirname:name of the directory

Delete

Delete file on the server

Arguments

Argument Type Default value Description
filepath strpath to server file
param filepath:path to server file

Download

Download file from FTP server

Arguments

Argument Type Default value Description
remotefile strpath to remote file on the server
localfile str Nonename of the downloaded file on the local filesystem, if None will have same name as remote file
param remotefile:
 path to remote file on the server
param localfile:
 name of the downloaded file on the local filesystem, if None will have same name as remote file

File Size

Return byte size of the file on the server

Arguments

Argument Type Default value Description
filepath strpath to server file
param filepath:path to server file

Get Welcome Message

Get server welcome message

return:welcome message

List Files

List files on the server directory

Arguments

Argument Type Default value Description
dirname str Nonename of the directory
param dirname:name of the directory

Mkd

Create a new directory on the server

Arguments

Argument Type Default value Description
dirname strname of the directory
param dirname:name of the directory

Pwd

Get current working directory on the server

Quit

Send QUIT command to the server and close connection

Rename

Rename file on the server

Arguments

Argument Type Default value Description
fromname strcurrent name of the file
toname strnew name for the file
param fromname:current name of the file
param toname:new name for the file

Rmd

Remove directory on the server

Arguments

Argument Type Default value Description
dirname strname of the directory
param dirname:name of the directory

Send Command

Execute command on the server

Arguments

Argument Type Default value Description
command strname of the command to send

List of FTP commands: https://en.wikipedia.org/wiki/List_of_FTP_commands

param command:name of the command to send

Set Ascii Mode

Set transfer mode to ASCII

Set Binary Mode

Set transfer mode to BINARY

Set Debug Level

Set debug level for the library

Arguments

Argument Type Default value Description
level int 0integer value of debug level, defaults to 0
param level:integer value of debug level, defaults to 0

0 - no debugging output 1 - moderate amount of debugging 2+ - higher amount of debugging

Upload

Upload file to FTP server

Arguments

Argument Type Default value Description
localfile strpath to file to upload
remotefile strname of uploaded file in the server
param localfile:
 path to file to upload
param remotefile:
 name of uploaded file in the server