Created
March 15, 2014 03:11
-
-
Save opnchaudhary/9561355 to your computer and use it in GitHub Desktop.
A sample example for uploading files using ftp in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import ftplib | |
session = ftplib.FTP('example.com','username','password') | |
file = open('cup.mp4','rb') # file to send | |
session.storbinary('STOR '+'cup.mp4', file) # send the file | |
file.close() # close file and FTP | |
session.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what if the file i want to upload it not in the same path?
how can i specified another file with different path which the end user is want?