I have the following code which easily connects to the FTP server and opens a zip file. I want to download that file into the local system. How to do that?
FILENAME = 'StarWars.avi'
with ftplib.FTP(FTP_IP, FTP_LOGIN, FTP_PASSWD) as ftp:
ftp.cwd('movies')
with open(FILENAME, 'wb') as f:
ftp.retrbinary('RETR ' + FILENAME, f.write)
Of course it would we be wise to handle possible errors.