Skip to content

Instantly share code, notes, and snippets.

@opnchaudhary
Created March 15, 2014 03:11
Show Gist options
  • Save opnchaudhary/9561355 to your computer and use it in GitHub Desktop.
Save opnchaudhary/9561355 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()
@Beyarz
Copy link

Beyarz commented Sep 20, 2018

@neemosh
import os
os.chdir("/another-path")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment