Is there a way I can store the output of retrbinary function from ftplib into a file object in python? The idea is to retrieve files from ftp server and upload them to s3 bucket using lambda function. Want to know if this can be done using ftplib alone without using paramiko library.
import ftplib
server = ftplib.FTP()
server.connect(xxxx)
server.login()
with open('test.xlsx',wb) as fp:
server.retrbinary('RETR test.xlsx',fp.write)
server.quit()
The above code download the test.xlsx file to local but instead I need to store it into a fileobject.