[Tutor] ftplib

Timothy M. Brauch tbrauch@mindless.com
Sat Feb 1 17:48:00 2003


Yes, I finally figured it out.  I was trying to store file.read(), instead
of just file.

 - Tim

===================
From: Bob Gailer
Did you study the ftplib documentation in the Python Library reference? It
offers:storbinary(command, file[, blocksize])
Store a file in binary transfer mode. command should be an appropriate
"STOR" command: "STOR filename". file is an open file object which is read
until EOF using its read() method in blocks of size blocksize to provide the
data to be stored. The blocksize argument defaults to 8192. Changed in
version 2.1: default for blocksize added.


storlines(command, file)
Store a file in ASCII transfer mode. command should be an appropriate "STOR"
command (see storbinary()). Lines are read until EOF from the open file
object file using its readline() method to provide the data to be stored.
Bob Gailer