Skip to content

Instantly share code, notes, and snippets.

@duncangh
Forked from opnchaudhary/ftp_uploader.py
Created November 12, 2018 23:40
Show Gist options
  • Save duncangh/54fe7062c4341f50ae80517466a0d32c to your computer and use it in GitHub Desktop.
Save duncangh/54fe7062c4341f50ae80517466a0d32c to your computer and use it in GitHub Desktop.
A sample example for uploading files using ftp in python
#!/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