#!/usr/bin/python from ftplib import FTP import os filename = 'file to upload' host = 'host address' user = 'your username' password = 'your password' hostdir = 'host target directory' ftp = FTP(host) ftp.login(user,password) ftp.cwd(hostdir) ftp.storbinary('STOR ' + filename,open(filename,'rb')) ftp.quit()