Abort

Arguments

Abort a file transfer in progress

Close

Arguments

Close connection to the server unilaterally

Connect

Arguments

  • host: str
  • port: int = 21
  • user: str = None
  • password: str = None
  • tls: bool = False
  • transfer: str = passive

Connect to FTP server

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

Arguments

  • dirname: str

Change working directory on the server

param dirname:name of the directory

Delete

Arguments

  • filepath: str

Delete file on the server

param filepath:path to server file

Download

Arguments

  • remotefile: str
  • localfile: str = None

Download file from FTP server

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

Arguments

  • filepath: str

Return byte size of the file on the server

param filepath:path to server file

Get Welcome Message

Arguments

Get server welcome message

return:welcome message

List Files

Arguments

  • dirname: str = None

List files on the server directory

param dirname:name of the directory

Mkd

Arguments

  • dirname: str

Create a new directory on the server

param dirname:name of the directory

Pwd

Arguments

Get current working directory on the server

Quit

Arguments

Send QUIT command to the server and close connection

Rename

Arguments

  • fromname: str
  • toname: str

Rename file on the server

param fromname:current name of the file
param toname:new name for the file

Rmd

Arguments

  • dirname: str

Remove directory on the server

param dirname:name of the directory

Send Command

Arguments

  • command: str

Execute command on the server

List of FTP commands

https://en.wikipedia.org/wiki/List_of_FTP_commands

param command:name of the command to send

Set Ascii Mode

Arguments

Set transfer mode to ASCII

Set Binary Mode

Arguments

Set transfer mode to BINARY

Set Debug Level

Arguments

  • level: int = 0

Set debug level for the library

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

param level:integer value of debug level, defaults to 0

Upload

Arguments

  • localfile: str
  • remotefile: str

Upload file to FTP server

param localfile:
 path to file to upload
param remotefile:
 name of uploaded file in the server