Send A File Using Ftp

Original post at

import ftplib                                          # We import the FTP module
session = ftplib.FTP('','login','passord') # Connect to the FTP server
myfile = open('toto.txt','rb')                         # Open the file to send
session.storbinary('STOR toto.txt', myfile)            # Send the file
myfile.close()                                         # Close the file
session.quit()                                         # Close FTP session
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.