FTP
Connect to your ftp server

Connect

You must Connect before any other methods
1
user = "my user"
2
passwd = "my passwd"
3
ftp = naas_drivers.ftp.connect(user, passwd)
Copied!

Connect Secure (FTPS)

1
user = "my user"
2
passwd = "my passwd"
3
ftp = naas_drivers.ftp.connect(user, passwd, port=990, secure=True)
Copied!

Connect and force Protocol

1
user = "my user"
2
passwd = "my passwd"
3
ftp = naas_drivers.ftp.connect(user, passwd, secure=True, force_prot=True)
Copied!

Get file

1
path = "/path/to/file/in/ftp"
2
user = "my user"
3
passwd = "my passwd"
4
ftp = naas_drivers.ftp.connect(user, passwd)
5
ftp.get(path)
Copied!

Send file

1
path = "/path/to/local/file"
2
dest_path = "/path/to/file/in/ftp"
3
user = "my user"
4
passwd = "my passwd"
5
ftp = naas_drivers.ftp.connect(user, passwd)
6
ftp.send(path, dest_path)
Copied!

List file

1
user = "my user"
2
passwd = "my passwd"
3
ftp = naas_drivers.ftp.connect(user, passwd)
4
ftp.list_directory()
Copied!