How to FTP a ASCII file

tedpottel at gmail.com tedpottel at gmail.com
Sat Jul 7 08:34:45 EDT 2007


On Jul 2, 7:07 pm, Adonis Vargas <ado... at REMOVETHISearthlink.net>
wrote:
> tedpot... at gmail.com wrote:
> > Hi,
>
> > My program has the following code to transfer a binary file
>
> >         f = open(pathanme+filename,'rb')
> >         print "start transfer"
> >         self.fthHandle.storbinary('STOR '+filename, f)
>
> > How can I do anASCIIfile transfer??????
> > -Ted
>
> Taken from online documentation:
>
> http://docs.python.org/lib/ftp-objects.html
>
> storlines(command, file)
>
> Store a file inASCIItransfer 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.
>
> Hope this helps.
>
> Adonis

Thank you it waqs soooo simple, works fine now!!!!




More information about the Python-list mailing list