file transfer in multi user chat to muliple users

2019-05-27 02:26发布

问题:

i want to send files to multiple users in a one chat room so that i will be broadcasted to everyone. so far i havent found anything or any help on internet which resolve this issue.

currently what i tried is to send a single file to each users one by one but i think that is not an efficient way so if someone has another approach then please do let know.

i have tried sending file using si-filetransfer and bystream also. socks5 bytestream is not possible in javascript i guess so i havent tried that.

i am using openfire server and stophe.js to send files using javascript and XMPP protocol

回答1:

Upload the file to a server (e.g. your OpenFire server) where users can download the file from.

To notify your users that they need to download a file, send them a stanza using XEP-0066: Out of Band Data or encode the link in a stanza as described in XEP-0071.

References:

  • http://xmpp.org/extensions/xep-0066.html

  • http://xmpp.org/extensions/xep-0071.html