You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This specification defines a profile of the XMPP stream initiation extension for transferring files between two entities. The protocol provides a modular framework that enables the exchange of information about the file to be transferred as well as the negotiation of parameters such as the transport to be used.
Usage
Include strophe.si-filetransfer.js in the head of your page. The will allow you to send and receive stream initiations. In order to actually transfer files, you'll need to also include a transport mechanism, like In-Band Bytestreams or Out-of-Band Data.
Add a handler to listen for stream initiations, or use send to initiate some of your own.
varconnection=newStrophe.Connection();varfileHandler=function(from,sid,filename,size,mime){// received a stream initiation// be prepared};connection.si_filetransfer.addFileHandler(fileHandler);// send a stream initiationconnection.si_filetransfer.send(to,sid,filename,size,mime,function(err){if(err){returnconsole.log(err);}// start sending file});