使用strophe传输XMPP文件



我使用enyo js作为前端,并尝试使用xmpp从web应用程序传输文件。我有一个插件strophe.si-filetransfer.js

对于发送消息,我使用以下内容:

$msg({to   : room,
      type : 'chat'
    }).c('body').t(message);
BoshSession.connection.send(smsg);

但我不知道我想用哪一节来发送附件,以及如何发送?

首先添加处理程序:

connection.si_filetransfer.(addhandler);

然后节看起来像这样(检查.js)

   connection.si_filetransfer.send(to, sid, filename, size, mime, cb);

最新更新