Table of Contents

FTP client in Python

Upload

#!/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()

Upload

 
howtos/ftp_python_client.txt · Last modified: 2010/05/12 11:24 by tanzox
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki