Establishing a Connection
The objects available within our connector are accessible from the "cdata.ftp" module. To use the module's objects directly:
- Import the module as follows:
import cdata.ftp as mod
- To establish a connection string, call the connect() method from the connector object using an appropriate connection string, such as:
mod.connect("RemoteHost=MyFTPServer;")
The CData Python Connector for FTP allows connecting to FTP servers.
Connecting to an FTP Server
FTP supports both plaintext and SSL/TLS connections. To connect to an FTP server specify the RemoteHost, User, and Password. Set SSLMode and SSLServerCert to secure connections with TLS/SSL. See SSL Configuration for more information on configuring connectivity over TLS/SSL.
Connecting to Data
Set the following connection properties to control the relational view of the file system:
- RemotePath: Set this to the current working directory.
- TableDepth: Set this to control the depth of subfolders to report as views.
- FileRetrievalDepth: Set this to retrieve files recursively and list them in the Root table.