[Standards] Request HTTP upload slots over XMPP
Peter.Waher at clayster.com
Tue Jun 30 17:45:01 UTC 2015
You could use XEP-0332, HTTP over XMPP, to do this. To upload content, simply perform a PUT, and you can then retrieve it using a normal GET.
If content is small, you can do the transfer in the same request. Otherwise, chunked service can be used, or integration with sipub, ibb and/or jingle as well, depending on capabilities.
Från: Daniel Gultsch [mailto:daniel at gultsch.de]
Skickat: den 28 juni 2015 09:26
Till: XMPP Standards
Ämne: [Standards] Request HTTP upload slots over XMPP
current file transfer techniques in XMPP all share the same downside. They are P2P and thus don't work with Carbons and MUCs. The synchronous nature of P2P protocols also doesn't play nicely with MAM.
Uploading files manually to an HTTP server and sharing the link has been an workaround for this for a long time now. (This has also been used in the good old IRC age)
While users have a variety of services to choose from (imgur, mediacrush, self hosted OwnCloud, Google Drive, ...) the major downside of this is that an xmpp client can not automate this process since the different services don't share a common api.
Furthermore using a third party service might require the user to enter additional credentials on top of the XMPP credentials.
Thus it would make perfect sense to have the xmpp provider also provide a way to upload files to an HTTP server.
Today I want to introduce a simple protocol for requesting what I call 'HTTP upload slots'.
An HTTP upload slot is basically a tuple of a PUT and a GET URL.
The user requests a slot from a component (most commonly running on the users servers and discoverable by disco items) providing a desired file name and a file size. The component does some checking on the data (quota, max file size, authorization) and provides the user with a PUT and a GET url which both are unique. (long random string in path)
<iq to='upload.domain.tld' id='random1' type='get'>
<iq to='user at domain.tld' id='random1' type='result'>
Note that the get and put host are not the same. This allows for the files to (optionally) be served over some standard HTTP server /or even a CDN.
Also note that the user provided file name is reflected in the GET url as well this way allowing the recipient of that URL to see the original file name. (However this is the something a sane component should do and is not required)
I would like to get some comments before I actually put this down into a XEP.
For those interested here: https://github.com/siacs/HttpUploadComponent is a sample python implementation of such a component.
And here is a branch for Conversations that can talk to that component. https://github.com/siacs/Conversations/tree/feature/http_upload
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Standards