FTP

Connect to your ftp server

Connect

You must Connect before any other methods

user = "my user"
passwd = "my passwd"
ftp = naas_drivers.ftp.connect(user, passwd)

Connect Secure (FTPS)

user = "my user"
passwd = "my passwd"
ftp = naas_drivers.ftp.connect(user, passwd, port=990, secure=True)

Connect and force Prot (FTPS Toucan toco)

user = "my user"
passwd = "my passwd"
ftp = naas_drivers.ftp.connect(user, passwd, secure=True, force_prot=True)

Get file

path = "/path/to/file/in/ftp"
user = "my user"
passwd = "my passwd"
ftp = naas_drivers.ftp.connect(user, passwd)
ftp.get(path)

Send file

path = "/path/to/local/file"
dest_path = "/path/to/file/in/ftp"
user = "my user"
passwd = "my passwd"
ftp = naas_drivers.ftp.connect(user, passwd)
ftp.send(path, dest_path)

List file

user = "my user"
passwd = "my passwd"
ftp = naas_drivers.ftp.connect(user, passwd)
ftp.list_directory()