Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Korakot Chaovavanich http://korakot.stumbleupon.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Send a file using FTP

   1  
   2  import ftplib
   3  s = ftplib.FTP('myserver.com','login','password') # Connect
   4  
   5  f = open('todo.txt','rb')                # file to send
   6  s.storbinary('STOR todo.txt', f)         # Send the file
   7  
   8  f.close()                                # Close file and FTP
   9  s.quit()

Taken (with some mod.) from here
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS