Coding problems with ftplib and uploading a file

pem at pem at
Fri Feb 18 20:58:27 CET 2000


I am new to python and have my first program near completion, however
the last step has caused me great troubles.  What I need to do is
upload a file to a server via ftp.  Very simple.  My code looks like

     ftp = FTP('servername')
     ftp.login('uname', 'passwd')
     fini = open('/myfile.html').readlines()
     ftp.storlines('STOR ' fini)

All of the commands work just fine except for the storlines command.  I
have read all of the documentation available to me at work (Programming
in Python and Learning Python, and web docs on ftplib) but none are
clear about the syntax of the storlines command.  In addition, I read
the as well as the rfc 959 on FTP and I guess I am just not
getting it.  Any help would be greatly appreciated.

BTW, Python is a wonderful programming language.  I don't think I will
ever go back to Perl.

Sent via
Before you buy.

More information about the Python-list mailing list