[Twisted-Python] using ftpclient storeFile question
Stéphane Brault
stephane_brault at yahoo.fr
Wed Jul 19 07:53:55 MDT 2006
Thanks Thomas,
as I ran in the bug, almost got crazy, I searched and found the ticket ;-)
Stéphane
----- Message d'origine ----
De : Thomas Jacob <jacob at internet24.de>
À : Twisted general discussion <twisted-python at twistedmatrix.com>
Envoyé le : Mercredi, 19 Juillet 2006, 3h16mn 12s
Objet : Re: [Twisted-Python] using ftpclient storeFile question
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
_______________________________________________
Twisted-Python mailing list
Twisted-Python at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
More information about the Twisted-Python
mailing list