Last active
December 16, 2015 14:08
-
-
Save macloo/5446265 to your computer and use it in GitHub Desktop.
Python FTP script for uploading a single file
This file contains 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
import ftplib | |
session = ftplib.FTP('HOSTNAME','USERNAME','PASSWORD') | |
session.cwd('//DIR//DIR//DIR//') | |
f = open('Downloads/picture.jpg', 'r') | |
session.storbinary('STOR pic2.jpg', f) | |
f.close() | |
session.quit() | |
# http://www.pythonforbeginners.com/code-snippets-source-code/how-to-use-ftp-in-python/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment