newbie question: ftp.storbinary()

Facundo Batista facundo at taniquetil.com.ar
Wed Jan 24 07:53:16 EST 2007


Scott Ballard wrote:

> Sorry for the lame question, I'm still trying to pick up Python and new to 
> the list here.

Welcome!


> I'm assuming that  I should use storbinary( command, file[, blocksize]) to 
> transfer the files. the documentation says "command should be an appropriate 
> "STOR" command: "STOR filename"."

For example:

>>> fp = open("/tmp/file_to_transfer.txt")   # open the file
>>> self.ftp.storbinary("STOR file_to_transfer.txt", fp)   # note that the name has not the path
>>> fp.close()  # close the file, :)

Regards,

-- 
.   Facundo
.
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/





More information about the Python-list mailing list