[Standards] NEW: XEP-0363 (HTTP File Upload)

Evgeny Khramtsov xramtsov at gmail.com
Thu Sep 3 11:11:32 UTC 2015


Thu, 27 Aug 2015 16:10:18 +0000 (UTC)
XMPP Extensions Editor <editor at xmpp.org> wrote:

> Version 0.1 of XEP-0363 (HTTP File Upload) has been released.
> 
> Abstract: This specification defines a protocol to request
> permissions from another entity to upload a file to a specific path
> on an HTTP server and at the same time receive a URL from which that
> file can later be downloaded again.
> 
> Changelog: Initial published version approved by the XMPP Council.
> (XEP Editor (mam))
> 
> Diff: http://xmpp.org/extensions/diff/api/xep/0363/diff/0.1/vs/0.1
> 
> URL: http://xmpp.org/extensions/xep-0363.html
> 

It would be great if the protocol supports image thumbnails
(optionally). A server could generate thumbnails during upload so a
client don't need to convert image locally. This will reduce
cpu/battery usage on mobile devices, simplify clients code and will
prevent UI from freezing during image transformation). I think
there are two ways implementing it:

1) The thumbnail SHOULD be returned with HTTP response, e.g.:
HTTP/1.1 200 OK
Content-Type: text/xml
...
<thumbnail xmlns='urn:xmpp:thumbs:1'
   uri='https://download.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/thumb.png'
   media-type='image/png'
   width='128'
   height='96'/>

(the <thumnail/> element is described in XEP-0264)

2) Another way is introducing new stanza which will be sent by an XMPP
server when upload is complete, for example:

<iq from='upload.montague.tld
    id='step_03'
    to='romeo at montague.tld/garden
    type='set'>
  <response xmlns='urn:xmpp:http:upload'>
    <thumbnail xmlns='urn:xmpp:thumbs:1'
                     uri='cid:sha1+ffd7c8d28e9c5e82afea41f97108c6b4 at bob.xmpp.org'
                     media-type='image/png'
                     width='128'
                     height='96'/>
  </response>
</iq>

Also, <response/> element could be extended to notify a client about
upload status.

This thumbnail then can be put into file-transfer offer using either
jingle http transport protoXEP or directly into jabber:x:oob message,
e.g:

<message
    from='coven at chat.shakespeare.lit/firstwitch'
    id='162BEBB1-F6DB-4D9A-9BD8-CFDCC801A0B2'
    to='hecate at shakespeare.lit/broom'
    type='groupchat'>
  <body>https://download.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/my_juliet.png</body>
  <x xmlns='jabber:x:oob'>
    <url>https://download.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/my_juliet.png</url>
    <desc>file</desc>
    <thumbnail xmlns='urn:xmpp:thumbs:1'
                     uri='https://download.montague.tld/4a771ac1-f0b2-4a4a-9700-f2a26fa2bb67/thumb.png'
                     media-type='image/png'
                     width='128'
                     height='96'/>

  </x>
</message>



More information about the Standards mailing list