def download_file(host, file_path, file_name):
try:
ftp = ftplib.FTP(host)
ftp.login()
ftp.cwd(file_path)
ftp.retrbinary('RETR ' + file_path + file_name, open(file_name, 'wb').write)
logger.success('Download: %s' % host + file_path + file_name)
ftp.quit()
except ftplib.all_errors as e:
logger.error('%s\nCannot download file: %s.' % (e, host + file_path + file_name))
评论列表
文章目录