[Twisted-Python] using ftpclient storeFile question

Thomas Jacob jacob at internet24.de
Wed Jul 19 09:16:12 EDT 2006


Sort of like this:

def upload_sendfile(consumer, fileObj);
  FileSender().beginFileTransfer(fileObj, consumer).addCallback(  
                lambda _: consumer.finish()).addCallback(
                lambda _: fileObj.close())

dC,dL = ftpClient.storeFile(target_file)
dC.addCallback(upload_sendfile, open(source_file,'rb'))

Unfortunately though, this only works with a patched Twisted 2.4.0 
(http://twistedmatrix.com/trac/ticket/1794)

On Wed, 2006-07-19 at 12:50 +0000, Stéphane Brault wrote:
> Hi, 
>  I'm using twisted to create a ftp client. The only problem I have is I don't understand how to upload a file (using storeFile), since the only parameters this function has is the path where to store the file. How do I indicate which file to upload ?
>  
>  Thanks,
>  
>  Stéphane
> 
> 
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20060719/b367ae2b/attachment.pgp 


More information about the Twisted-Python mailing list