-
-
Save duncangh/54fe7062c4341f50ae80517466a0d32c 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