[code]from ftplib import FTP
ftp = FTP(‘address.com’) # connect to host, default port
ftp.login(‘username’,‘password’) # user anonymous, passwd anonymous@
filename = fpmi.file.getTempFile(“gz”) #create temp file
ftp.retrbinary(‘RETR ftpfile.gz’, open(filename,‘wb’).write) #download file and write to tempfile
Why would the file not be completely downloaded? I have checked the temp file and it is also cut off. when i try to extract the file i receive a unexpected end of archive crc failed the file is corrupt error.