Skip to content

Instantly share code, notes, and snippets.

@auselen
Created December 13, 2015 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save auselen/e0899dc9b0897157b63f to your computer and use it in GitHub Desktop.
Save auselen/e0899dc9b0897157b63f to your computer and use it in GitHub Desktop.
Simple ftp upload client using ftplib
import os
import sys
from ftplib import FTP
# python ftpput.py [server] [dir_on_server] [local_dir]
ftp = FTP(sys.argv[1])
ftp.login()
ftp.cwd(sys.argv[2])
for root, dirs, files in os.walk(sys.argv[3]):
ftp.mkd(root)
print root
for f in files:
ff = root + '/' + f
print ff
ftp.storbinary('STOR ' + ff, open(ff, 'rb'))
ftp.quit()
@FAROUKix
Copy link

FAROUKix commented Jan 8, 2016

no upload :'(

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