以python lib 上傳檔案到ftp


from ftplib import FTP

ftp = FTP('65.254.248.153')
 ftp.login('tagtooorg','cusps-1110')
 ftp.cwd('/static/TagAndContentMatch')
   
 f = open("test.txt", "rb")
 ftp.storbinary('STOR ' + 'test.txt', f)
 f.close()
 print "OK"
 ftp.quit()

留言

熱門文章