How can I send data with xmpppy?


How can I send data with xmpppy using this method:

I suppose I should use IBB class but have no idea how to do it.

First, if you're on GoogleTalk, ensure that the sender is on the receiver's roster. Next, on the sender side:

from xmpp import *
cl.auth('sender', 'sender_pass')
ibb = filetransfer.IBB()

f = open('/tmp/foo')
ibb.OpenStream('123', '[email protected]/resource', f)

It doesn't matter what the stream ID is if you're not doing XEP-95/XEP-96 correctly first.