%ents; ]>
SI File Transfer 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. &LEGALNOTICE; 0096 Draft Standards Track Standards XMPP Core XEP-0095 si-filetransfer http://www.xmpp.org/schemas/file-transfer.xsd &temas; &linuxwolf; &reatmon; &stpeter; 1.2rc1 in progress, last updated 2010-08-16 psa Specified hash agility, including 'algo' attribute. 1.1 2004-04-13 psa More fully defined the XMPP Registrar considerations. 1.1 2003-12-30 psa Improved explanatory text; fixed several errors in the schema. 1.0 2003-10-17 psa Per a vote of the Jabber Council, advanced status to Draft. 0.7 2003-10-07 tjm Added IBB as a MUST requirement. 0.6 2003-08-18 tjm Cleaned up some namespace inconsistencies, added the <desc> element for file descriptions. 0.5 2003-07-15 rwe Stream ids not needed on return results. Moved s5b, ibb, and url-data to the actual namespaces of the stream protocols. 0.4 2003-06-30 lw Fixed various typos and inconsistencies 0.3 2003-06-30 lw Added XML Schema 0.2 2003-06-24 tjm Clarified many examples, added linuxwolf as an author (again, my bad, should have been there), clarified the allowed streams and how data is sent over it. 0.1 2003-06-10 tjm Initial version.

The traditional mechanism for transferring files in the Jabber community is the &xep0066; protocol. That protocol has several drawbacks:

  1. It is not reliable.
  2. It does not work when one of the parties is behind a firewall.
  3. It provides limited metadata about files to be exchanged.

The current document defines a profile of &xep0095; that solves the problems with out-of-band data, thus providing a robust, reliable mechanism for file transfers over the Jabber network. Implementors are referred to XEP-0095 regarding the underlying concepts of stream initiation.

The file transfer profile is in the "http://jabber.org/protocol/si/profile/file-transfer" namespace. The profile is fairly simple: it consists of the root element with the possibility of one child describing the optional ranged transfers.

The root element is <file> and has five attributes. The attributes are used only during the offer stage of stream initiation:

The size and name attributes MUST be present in the profile. The other attributes MAY be present.

There are two possible child elements of the root: <desc> and <range>. Both are OPTIONAL.

<desc> is used to provide a sender-generated description of the file so the receiver can better understand what is being sent. It MUST NOT be sent in the result.

When <range> is sent in the offer, it should have no attributes. This signifies that the sender can do ranged transfers. When a Stream Initiation result is sent with the <range> element, it uses these attributes:

Both attributes are OPTIONAL on the <range> element. Sending no attributes is synonymous with not sending the <range> element. When no <range> element is sent in the Stream Initiation result, the Sender MUST send the complete file starting at offset 0. More generally, data is sent over the stream byte for byte starting at the offset position for the length specified.

In order to enable seamless file transfer and appropriate fall-back mechanisms, implementations of this profile MUST support both &xep0065; and &xep0047;, to be preferred in that order. The associated namespaces are to be included as option values for the "stream-method" variable as shown in the examples below.

Additionally, implementations MAY support other mechanisms.

]]> http://jabber.org/protocol/bytestreams ]]> This is a test. If this were a real file... ]]> http://jabber.org/protocol/bytestreams ]]>

This range should retrieve 256 bytes from the beginning of the file:

]]>

This range should retrieve 256 bytes starting from the 128th byte in the file:

]]>

This range should retrieve the remainder of the file starting at the 128th byte in the file:

]]>

This range is the same as having not sent the range request and the entire file is sent:

]]>

No interaction with &IANA; is required as a result of this document.

The profile described in this document is included in the stream initiation profiles registry maintained by the ®ISTRAR; (see &SIPROFILES;). The registry submission is as follows:

http://jabber.org/protocol/si/profile/file-transfer XEP-0096 A profile for file transfer between any two entities. ]]>

As authorized by &xep0147;, the XMPP Registrar maintains a registry of queries and key-value pairs for use in XMPP URIs (see &QUERYTYPES;).

As described below, the registered querytypes for file transfer actions are "sendfile" and "recvfile". Note well that "sendfile" means a second entity will send a file to the XMPP entity that controls the IRI/URI and that "recvfile" means a second entity will receive a file from the XMPP entity that controls the IRI/URI.

To enable a second entity to send a file, the IRI/URI is of the following form:

The application SHOULD then present an interface enabling the user to provide information about the file to be sent (e.g., by "browsing" the file system of the user's computer in order to choose a file). As a result, the application SHOULD then send a &xep0137; message to the XMPP address encapsulated in the IRI/URI:

]]>

The following submission registers the "sendfile" querytype.

sendfile http://jabber.org/protocol/si/profile/file-transfer enables initiation of an inbound file transfer to XMPP entity XEP-0096 ]]>

To enable a second entity to receive a file, the IRI/URI is of the following form:

That IRI/URI is equivalent to the following XML stanza:

]]>

In accordance with XEP-0137, the application SHOULD then initiate a file transfer exchange with by sending a stanza of the following form:

]]>

Note well that the request to begin the stream is sent to the full JID (user@host/resource) of the XMPP entity identified by the XMPP IRI/URI. Therefore, the IRI/URI SHOULD include a full JID. If it does not, the receiver MUST discover a full JID via presence or service discovery. If the receiver cannot discover a full JID for the sender (e.g., in the last resort through sending a presence subscription request to the sender and receiving presence from the sender's resources), then it SHOULD abort the file transfer exchange.

The following submission registers the "recvfile" querytype.

recvfile http://jabber.org/protocol/si/profile/file-transfer enables initiation of an outbound file transfer from XMPP entity XEP-0096 algo the hash algorithm used to generate the checksum hash a checksum of the file contents mime-type the MIME type of the file being offered name the name of the file being offered sid the session ID associated with the file being offered size the size in bytes of the file being offered ]]>
The protocol documented by this schema is defined in XEP-0096: http://www.xmpp.org/extensions/xep-0096.html ]]>