from ftplib import FTP
### FTP setting:
host = 'x.x.x.x'
username = 'user'
password = 'mima'
remotepath = '/home/user/'
def upload_ftp(filepath):
f = FTP(host)
f.login(username,password)
f.cwd(remotepath)
fd = open(filepath,'rb')
f.storbinary('STOR %s'%os.path.basename(filepath),fd)
fd.close()
f.quit()
功能: 通过FTP上传文件到指定路径 其他示例