diff --git a/xep-0231.xml b/xep-0231.xml index 18606943..01bc3a01 100644 --- a/xep-0231.xml +++ b/xep-0231.xml @@ -24,6 +24,12 @@ NOT_YET_ASSIGNED &stpeter; + + 0.2 + 2008-05-29 + psa +

Added service discovery feature for in-band message images use case.

+
0.1 2008-01-30 @@ -57,12 +63,12 @@ -

Sometimes it is desirable to include a small bit of binary data in an XMPP stanza. Typical use cases might be inclusion of an icon or emoticon in a message, a thumbnail in a file transfer request, a rasterized image in a whiteboarding session, or a small bit of media in a data form. At present, there is no lightweight method for including such data in an XMPP stanza, since existing methods (e.g., &xep0047;) are designed for larger blobs of data and therefore require some form of negotiation (e.g., via &xep0096; or &xep0166;). Therefore, this document specifies just such a lightweight method, using a <data/> element that provides semantics similar to the data: URL scheme defined in &rfc2397;.

+

Sometimes it is desirable to include a small bit of binary data in an XMPP stanza. Typical use cases might be inclusion of an icon or emoticon in a message, a thumbnail in a file transfer request, a rasterized image in a whiteboarding session, or a small bit of media in a data form. At present, there is no lightweight method for including such data in an XMPP stanza, since existing methods (e.g., &xep0047;) are designed for larger blobs of data and therefore require some form of negotiation (e.g., via &xep0096; or &xep0234;). Therefore, this document specifies just such a lightweight method, using a <data/> element that provides semantics similar to the data: URL scheme defined in &rfc2397;.

-

The format for including binary data is straightforward: the data is encapsulated as the XML character data of a <data/> element, where the data MUST be encoded as Base64 in accordance with Section 4 of &rfc4648; (note: the Base64 output MUST NOT include whitespace and MUST set the number of pad bits to zero).

-

The <data/> element SHOULD be used only to encapsulate small bits of binary data and SHOULD NOT be used for large data transfers. Naturally the definitions of "small" and "large" are rather loose. In general, it is recommended that the data should not be more than 8 kilobytes and that dedicated file transfer methods should be used for exchanging blobs of data larger than 8 kilobytes. Naturally, implementations or deployments may impose their own limits.

+

The format for including binary data is straightforward: the data is encapsulated as the XML character data of a <data/> element qualified by the 'urn:xmpp:tmp:data-element' namespace &NSNOTE;, where the data MUST be encoded as Base64 in accordance with Section 4 of &rfc4648; (note: the Base64 output MUST NOT include whitespace and MUST set the number of pad bits to zero).

+

The <data/> element MUST be used only to encapsulate small bits of binary data and MUST NOT be used for large data transfers. Naturally the definitions of "small" and "large" are rather loose. In general, the data SHOULD NOT be more than 8 kilobytes, and dedicated file transfer methods (e.g., &xep0065; or &xep0047;) SHOULD be used for exchanging blobs of data larger than 8 kilobytes. Naturally, implementations or deployments may impose their own limits.

The following attributes are defined for the <data/> element.

@@ -103,8 +109,9 @@ - +

The <data/> element can be used in conjunction with &xep0071; and the cid: URL scheme to point to binary data that is provided in-band within a &MESSAGE; stanza.

+

Note: The sender SHOULD NOT include an in-band image unless the intended recipient advertises (via &xep0030; or &xep0115;) support for the "urn:xmpp:tmp:data-element:inband-image" service discovery feature &NSNOTE;.

]]> -

Once the data is provided, a subsequent message in the same session can refer to the data again without including it.

+

Once the data is provided, a subsequent message in the same session can refer to the data again without including the data itself.

]]> -

If the receiving entity has not cached the data, it can request the data as described in the next section.

+

If the receiving entity has not cached the data, it can request the data as described in the Retrieving Data section of this document.

- -

Data can be requested and transferred using the XMPP &IQ; stanza type by making reference to the 'cid' of the data to be retrieved. In particular, the requesting entity can request data by sending an IQ-get containing an empty <data/> element with a 'cid' attribute.

- - - - ]]> -

The responding entity then would either return an error (e.g., ¬found; if it does not have data matching the Content-ID) or return the data.

- - - iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP - C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA - AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J - REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq - ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0 - vr4MkhoXe0rZigAAAABJRU5ErkJggg== - - - ]]> -

This specification does not place limits on the entities from which data can be requested. In particular, such an entity need not be the "owner" of the data (e.g., it could be a peer in a chatroom or whiteboarding session).

-

In addition, bits of data could be hosted by XMPP servers, distributed via &xep0060; nodes, or included in data collections that are available via HTTP (e.g., emoticon sets). Such data could be identified by the value of the 'cid' attribute, but methods for specifying those values are out of scope for this specification.

-
- - +

&xep0221; describes how to include a media element in &xep0004;, e.g. for the purpose of placing a human-viewable "CAPTCHA" in a form that is used for &xep0158; or &xep0077;. The <media/> element described in XEP-0221 contains one or more <uri/> elements (which point to locations where the media can be downloaded, e.g. via HTTP) as well as a <data/> element that includes the data itself. The <media/> element would contain a <data/> element as described herein and shown in the following example.

@@ -209,8 +182,9 @@

The media would then be included in a data form as illustrated in XEP-0221.

- -

A previous proposal See <http://www.xmpp.org/extensions/inbox/file-preview.html>. described a method for including a thumbnail or file preview in a file transfer request. Such a preview can be included using the <data/> element, as shown below. However, a preview SHOULD NOT be included unless the receiving entity advertises (via &xep0030; or &xep0115;) support for the "urn:xmpp:tmp:file-preview" service discovery feature &NSNOTE;.

+ +

A previous proposal See <http://www.xmpp.org/extensions/inbox/file-preview.html>. described a method for including a thumbnail or file preview in a file transfer request. Such a preview can be included using the <data/> element, as shown below.

+

Note: The initiator SHOULD NOT include a file preview unless the receiving entity advertises (via XEP-0030 or XEP-0115) support for the "urn:xmpp:tmp:data-element:file-preview" service discovery feature &NSNOTE;.

+ +

Data can be requested and transferred using the XMPP &IQ; stanza type by making reference to the 'cid' of the data to be retrieved. In particular, the requesting entity can request data by sending an IQ-get containing an empty <data/> element with a 'cid' attribute.

+ + + + ]]> +

The responding entity then would either return an error (e.g., ¬found; if it does not have data matching the Content-ID) or return the data.

+ + + iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP + C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA + AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J + REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq + ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0 + vr4MkhoXe0rZigAAAABJRU5ErkJggg== + + + ]]> +

This specification does not place limits on the entities from which data can be requested. In particular, such an entity need not be the "owner" of the data (e.g., it could be a peer in a chatroom or whiteboarding session, or the chatroom or whiteboarding service itself).

+

In addition, bits of data could be hosted by XMPP servers, distributed via &xep0060; nodes, or included in data collections that are available via HTTP (e.g., emoticon sets). Such data could be identified by the value of the 'cid' attribute, but methods for specifying those values are out of scope for this specification.

+
+
@@ -385,12 +393,17 @@

Until this specification advances to a status of Draft, its associated namespace shall be "urn:xmpp:tmp:data-element"; upon advancement of this specification, the ®ISTRAR; shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;.

-

If an entity is willing to accept data elements in file transfer requests for the purpose of previewing the file to be sent, it SHOULD advertise support for the "urn:xmpp:tmp:file-preview" feature.

+

If an entity is willing to accept data elements in file transfer requests for the purpose of previewing the file to be sent, it SHOULD advertise support for the "urn:xmpp:tmp:data-element:file-preview" feature.

The registry submission is as follows.

- urn:xmpp:tmp:file-preview - Willingness to accept data elements to preview file transfers + urn:xmpp:tmp:data-element:file-preview + Signals a willingness to accept data elements for previewing file transfers + XEP-0230 + + + urn:xmpp:tmp:data-element:inband-image + Signals a willingness to accept data elements for in-band message images XEP-0230 ]]>