1
2
3
4
5
6
7
8
#!/usr/bin/env python
import ftplib
session = ftplib.FTP('server','usr','pwd')
myfile = open('test.txt','rb')
session.storbinary('STOR test.txt', myfile)
myfile.close()
session.quit()