This project is an FTP/FTPS client that allows you to upload, download, and list files on an FTP server. It supports secure connections via FTPS (FTP over TLS).
- Connect to FTP/FTPS servers using a hostname, username, password, and optional TLS encryption.
- Upload files from your local system to the remote FTP server.
- Download files from the FTP server to your local system.
- List files in a specified remote directory.
- Secure: Optionally use TLS to secure your FTP connection.
- Python 3.6+
- Required libraries:
ftplib
ssl
(for FTPS)
- Clone the repository or download the script.
- Install any necessary dependencies (if applicable).
- Edit the
main()
function in the script to provide your FTP server details.
Here's an example of how you can use the FTP client:
from ftp_client import FTPClient
def main():
ftp_client = FTPClient(hostname="ftp.example.com", username="user", password="pass", use_tls=True)
# Connect to the server
ftp_client.connect()
# Upload a file
ftp_client.upload_file("local/path/to/file.txt", "/remote/path/file.txt")
# Download a file
ftp_client.download_file("/remote/path/file.txt", "local/path/to/file.txt")
# List files in the remote directory
ftp_client.list_files("/remote/path/")
# Disconnect from the server
ftp_client.disconnect()
if __name__ == "__main__":
main()
- Connect: Establish a connection with the FTP/FTPS server.
- Upload File: Upload a file from the local machine to the FTP server.
- Download File: Download a file from the FTP server to the local machine.
- List Files: List all files in a specified remote directory.
- Disconnect: Close the connection to the FTP server.
This project is released under the MIT License.