from ftplib import FTP
from datetime import datetime
start = datetime.now()
ftp = FTP('your-ftp-domain-or-ip')
ftp.login('your-username','your-password')
# Get All Files
files = ftp.nlst()
# Print out the files
for file in files:
print("Downloading..." + file)
ftp.retrbinary("RETR " + file ,open("download/to/your/directory/" + file, 'wb').write)
ftp.close()
end = datetime.now()
diff = end - start
print('All files downloaded for ' + str(diff.seconds) + 's')`
Forked from nasrulhazim/dowload-files-from-ftp-server-using-python3.md
Created
May 17, 2019 05:33
-
-
Save duncangh/93b9cf32736eeeee323d0f2071441fbf to your computer and use it in GitHub Desktop.
Download Files From FTP Server using Python3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment