[Tutor] Re: FTP: can't move a large file!

Bill Tolbert bill_tolbert@bigfoot.com
Fri, 27 Jul 2001 22:49:58 -0400 (EDT)


Got it! I had failed to open the file with read binary. The open command
should have been

  datafile = open("e:\\temp\\bigfile","rb")

Bill


On Fri, 27 Jul 2001, Bill Tolbert wrote:

> I'm having trouble getting the ftplib to move a 20meg file. It works fine
> for small files, but it moves only a small chunk of the large file then
> quits!
> 
> Here is a code sample:
> 
> import ftplib
> datafile = open("e:\\temp\\bigfile")
> 
> f = ftplib.FTP() 
> f.connect("myserver.org") 
> f.login("me","mypass")
> f.storbinary("STOR myfile", datafile, 1024)  
> f.close()
> 
> Is my file size the problem? 
> 
> Here's what the docs say:
> storbinary (command, file, blocksize) 
> Store a file in binary transfer mode. command should be an appropriate
> "STOR" command, i.e. "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. 
> 
> Thanks a lot,
> 
> Bill
> 
>