Skip to content

Instantly share code, notes, and snippets.

@MilosSimic
Forked from opnchaudhary/ftp_uploader.py
Created September 24, 2018 09:41
Show Gist options
  • Select an option

  • Save MilosSimic/eb7d26d8721fdda4e29ca727a32f5cbf to your computer and use it in GitHub Desktop.

Select an option

Save MilosSimic/eb7d26d8721fdda4e29ca727a32f5cbf 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