[jdev] File Transfer and custom attributes

Peter Saint-Andre stpeter at stpeter.im
Wed Mar 5 09:21:16 CST 2008


Matías Rojas wrote:
> Hi,
> 
> I’m using Stream Initiation (XEP-0095) and File Transfer (XEP-0096) to send
> a file, but I need to include additional information about the file I’m
> sending.

I'm curious: what information do you want to include? If it is of
general interest, perhaps we should update XEP-0096 to include it.

> What is the best way to send custom attributes of a file?
> 
> Should I use DataForm?

Sure, that might work...

<iq type='set' id='offer1' to='receiver at jabber.org/resource'>
  <si xmlns='http://jabber.org/protocol/si'
      id='a0'
      mime-type='text/plain'
      profile='http://jabber.org/protocol/si/profile/file-transfer'>
    <file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
          name='test.txt'
          size='1022'>
      <x xmlns='jabber:x:data' type='result'>
        <field var='FORM_TYPE' type='hidden'>
          <value>your-private-namespace-here</value>
        </field>
      <field var='your-first-private-field'>
        <value>a-value</value>
      </field>
      <field var='your-second-private-field'>
        <value>a-value</value>
      </field>
    </x>
    </file>
    <feature xmlns='http://jabber.org/protocol/feature-neg'>
      <x xmlns='jabber:x:data' type='form'>
        <field var='stream-method' type='list-single'>
          <option>
            <value>http://jabber.org/protocol/bytestreams</value>
          </option>
          <option>
            <value>http://jabber.org/protocol/ibb</value>
          </option>
        </field>
      </x>
    </feature>
  </si>
</iq>



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 7338 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20080305/1c3ebcfa/attachment-0002.bin>


More information about the JDev mailing list