Skip to content

Instantly share code, notes, and snippets.

@ekoew
ekoew / ftp-client-download.py
Last active July 4, 2018 11:01
School project by Eko Puji Pramono (5115100065) based on tutorial: http://www.techinfected.net/2017/07/create-simple-ftp-server-client-in-python.html
# download for anonymous user
from ftplib import FTP
ftp = FTP('')
ftp.connect('localhost',1026) # connect to host, default port
ftp.login() # login as anonymous user
ftp.cwd('anonymous') # change into "files" directory
print ("Permissions No. Owner Type Size Date Time Filename")
ftp.retrlines('LIST') # retrieve list of file in the directory