#!/usr/bin/env python
#-*- coding: utf-8 -*-
#-*- coding: utf-8 -*-
from ftplib import FTP
import sys,getpass,os.path
host = '10.1.1.1'
username ='test'
password = 'test'
localfile ='E:\\ftp_test.txt'
remotepath ='/test/test/test'
print "HELLO"
f =FTP(host)
f.login(username,password)
print "Welcome:",f.getwelcome()
f.cwd(remotepath)
fd = open(localfile,'rb')
f.storbinary('STOR %s' % os.path.basename(localfile),fd)
fd.close()
f.quit()