Help FTP upload

Janko Hauser jhauser at ifm.uni-kiel.de
Fri Nov 10 17:33:22 EST 2000


"Gilles Lenfant" <glenfant at equod.com.nospam> writes:

> Hi,
> 
> I try to make an FTP upload (Python 1.5.2/Win32) to a ProFTPD/Linux server:
> 
> ftps = ftplib.FTP('ahost', 'anuser', 'apasswd')
> ...
> filename = 'anyfile.foo'
> bufsize = 1024
> fh = open(filename, 'r')
On windows you need to open the file in binary mode with
fh = open(filename, 'rb')

HTH,
__Janko

-- 
  Institut fuer Meereskunde             phone: 49-431-597 3989
  Dept. Theoretical Oceanography        fax  : 49-431-565876
  Duesternbrooker Weg 20                email: jhauser at ifm.uni-kiel.de
  24105 Kiel, Germany



More information about the Python-list mailing list