How do I transfer a file over XMPP using Python?

I am using xmpppy for my jabber remote administration bot, but I cannot find how to send / receive a file and save it in a specified directory. The documentation is poor and there are no examples, but I really want to do this. Can anyone show some examples or some links about this? Or maybe I should be using alternative xmpp bindings?

+2


a source to share


2 answers


There are two XEP extensions (XMPP extensions) that cover file transfers: XEP-0096 http://xmpp.org/extensions/xep-0096.html (called SI (Stream Initiated) File Transfer) and XEP-0234 http: // xmpp.org/extensions/xep-0234.html (Jingle file transfer)

XEP-0096 is original, but I found that it is rarely implemented (as you found) in most libraries, and also for most clients. XEP-0234 is much newer and found in more modern clients, but not in older libraries (like xmpppy). The problem that you run into, even when you find a library or implementation of either of them, is that both sides of the connection must implement them as well.



Of the two, I would choose XEP-0234 because it covers quite a few issues that the original had and is considered a replacement for it.

As Python libraries don't support it. I looked at xmpppy, headstock, pyxmpp, jabber.py, curled words and my favorite file sleekxmppp.

+3


a source


Xmpppy has the xmpp.filetransfer module :



This module contains the IBB class, which is a simple implementation of JEP-0047. Please note that this is just a data transport. You need to agree in advance about the transfer of data (possibly through StreamInitiation). Unfortunately SI has not yet been implemented.

0


a source







All Articles