%ents;
]>
The traditional mechanism for transferring files in the Jabber community is the &jep0066; protocol. That protocol has several drawbacks: The current document defines a profile of &jep0095; 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 JEP-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 four 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:
In order to enable seamless file transfer and appropriate fall-back mechanisms, implementations of this profile MUST support both &jep0065; and &jep0047;, 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.
No interaction with &IANA; is required as a result of this JEP.
The profile described in this JEP 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
JEP-0096
A profile for file transfer between any two entities.
]]>
As authorized by &jep0147;, the Jabber 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 &jep0137; 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
JEP-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 JEP-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
JEP-0096
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
JEP-0096: http://www.jabber.org/jeps/jep-0096.html
]]>