Hi 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) Examples out: <iq to='upload.domain.tld' id='random1' type='get'> <request xmlns='urn:xmpp:http:upload'> <filename>a_picture.jpg</filename> </request> </iq> in: <iq to='[email protected]' id='random1' type='result'> <slot xmlns='urn:xmpp:http:upload'> <get> https://download.domain.tld/a_long_randomly_generated_path/a_picture.jpg </get> <put>https://upload.domain.tld/a_long_randomly_generated_path/a_picture.jpg </put> </slot> </iq> 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 cheers Daniel
