I have written this code that's suppose to send files over FTP. The problem is that in 3/5 cases the files are not fully getting to the other side -- I understand you have to use retrieve. I am writing this code for work so ignore the obnoxious "REDACTED" parts of the code. Currently, the only files that are reaching the other side in full are the .bin file and the Image file. -- They are the two smallest files as the other ones are quite big (the biggest is 19000 kb.) When the files are downloaded, they are very small compared to their original size. 35 kb compared to 10000 kb. 141 kb compared to 14000 kb. etc.
ftp = FTP('REDACTED')
ftp.login('REDACTED', 'REDACTED')
print ("Opening FTP...\n")
with open ('REDACTED.gz.uboot') as f:
print ('writing file...REDACTED.gz.uboot')
ftp.storbinary('STOR %s' % 'REDACTED.gz.uboot', f)
with open('REDACTED_Image', 'rb') as x:
print ("writing file...REDACTED_Image")
ftp.storbinary('STOR %s' % 'Image', f)
with open('REDACTED.rbf', 'rb') as f:
ftp.storbinary('STOR %s' % 'huh.rbf', f)
print ("writing file...m0_host_top.rbf")
with open ('REDACTED.tar.bz2') as f:
print ('writing file...REDACTED')
ftp.storbinary('STOR %s' % 'REDACTED', f)
with open ('REDACTED.bin') as f:
print ('writing file...REDACTED.bin')
ftp.storbinary('STOR %s' % 'REDACTED.bin', f)
Any help here would be greatly appreciated, I need to get the full files across. Edit: I am presuming that there is an issue with the upload because each time the files are uploaded, they are of different sizes.