How to FTP a ASCII file

tedpottel at gmail.com tedpottel at gmail.com
Sat Jul 7 08:35:44 EDT 2007


On Jul 2, 7:12 pm, John Machin <sjmac... at lexicon.net> wrote:
> On Jul 3, 9:02 am, "tedpot... at gmail.com" <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
>
> I'm really curious as to how you could find out how to upload a file
> in binary mode, but not inASCIImode.
>
> According to The Fantastic Manual:
> """
> 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 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.
> """

Hi,
I did a google on python file transfer and got links to sample code
using a binary transfer, but thier was no links to sample code using
ascc. Thank you for your help




More information about the Python-list mailing list