powered by Jive Software

Filetransfer with asmack

Hi everyone,

I have some problems which has confused me for days. When I send file, filetransferlistener works fine. But the size of received file is 0kb.

I set debug for true and here is my logcat:

06-25 05:07:29.317: D/SMACK(1008): 05:07:29 AM RCV  (-1261183816): <iq id="V3rGq-4" to="admin@strong/Smack" from="sam@strong/Smack" type="set"><si xmlns="http://jabber.org/protocol/si" id="jsi_3828818928404921117" mime-type="image/jpeg" profile="http://jabber.org/protocol/si/profile/file-transfer"><file xmlns="http://jabber.org/protocol/si/profile/file-transfer" name="test1.jpg" size="11201"><desc>test1</desc></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>
06-25 05:07:29.407: D/SMACK(1008): 05:07:29 AM SENT (-1261183816): <iq id="V3rGq-4" to="sam@strong/Smack" from="admin@strong/Smack" type="result"><si xmlns="http://jabber.org/protocol/si"><feature xmlns="http://jabber.org/protocol/feature-neg"><x xmlns="jabber:x:data" type="submit"><field var="stream-method"><value>http://jabber.org/protocol/bytestreams</value><value>http://jabber.org/protocol/ibb</value></field></x></feature></si></iq>
06-25 05:07:29.487: D/SMACK(1008): 05:07:29 AM RCV  (-1261183816): <iq id="V3rGq-5" to="admin@strong/Smack" type="get" from="sam@strong/Smack"><query xmlns="http://jabber.org/protocol/disco#info"/></iq>
06-25 05:07:34.557: D/SMACK(1008): 05:07:34 AM RCV  (-1261183816): <iq id="V3rGq-6" to="admin@strong/Smack" type="set" from="sam@strong/Smack"><open xmlns="http://jabber.org/protocol/ibb" block-size="4096" sid="jsi_3828818928404921117" stanza="iq"/></iq>
06-25 05:07:34.577: D/SMACK(1008): 05:07:34 AM SENT (-1261183816): <iq id="V3rGq-6" to="sam@strong/Smack" from="admin@strong/Smack" type="result"></iq>
06-25 05:07:34.657: D/SMACK(1008): 05:07:34 AM RCV  (-1261183816): <iq id="V3rGq-7" to="admin@strong/Smack" type="set" from="sam@strong/Smack"><data xmlns="http://jabber.org/protocol/ibb" seq="0" sid="jsi_3828818928404921117">/9j/4AAQSkZJRgABAQEAYABgA......
06-25 05:07:39.747: D/SMACK(1008): 05:07:39 AM RCV  (-1261183816): <iq id="V3rGq-8" to="admin@strong/Smack" type="set" from="sam@strong/Smack"><data xmlns="http://jabber.org/protocol/ibb" seq="0" sid="jsi_3828818928404921117">/9j/4AAQSkZJRgABAQEAYABgA......
06-25 05:07:44.697: D/SMACK(1008): 05:07:44 AM RCV  (-1261183816): <iq id="V3rGq-9" to="admin@strong/Smack" type="set" from="sam@strong/Smack"><close xmlns="http://jabber.org/protocol/ibb" sid="jsi_3828818928404921117"/></iq>

Thank you.

Regards,

Strong Su

06-25 05:07:29.317: D/SMACK(1008): 05:07:29 AM RCV (-1261183816):

 <si xmlns="[http://jabber.org/protocol/si](http://jabber.org/protocol/si)" id="jsi_3828818928404921117" mime-type="image/jpeg" profile="[http://jabber.org/protocol/si/profile/file-transfer](http://jabber.org/protocol/si/profile/file-transfer)">

      <file xmlns="[http://jabber.org/protocol/si/profile/file-transfer](http://jabber.org/protocol/si/profile/file-transfer)" name="test1.jpg" size="11201">

test1

      <feature xmlns="[http://jabber.org/protocol/feature-neg](http://jabber.org/protocol/feature-neg)">

<field var="stream-method"type=“listsingle”>

                          <value>[http://jabber.org/protocol/bytestreams](http://jabber.org/protocol/bytestreams)</value>
                          <value>[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)</value>

06-25 05:07:29.407: D/SMACK(1008): 05:07:29 AM SENT (-1261183816):

 <si xmlns="[http://jabber.org/protocol/si](http://jabber.org/protocol/si)">

      <feature xmlns="[http://jabber.org/protocol/feature-neg](http://jabber.org/protocol/feature-neg)">
                     <value>[http://jabber.org/protocol/bytestreams](http://jabber.org/protocol/bytestreams)</value>

                     <value>[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)</value>

06-25 05:07:29.487: D/SMACK(1008): 05:07:29 AM RCV (-1261183816):

      <query xmlns="[http://jabber.org/protocol/disco#info](http://jabber.org/protocol/disco#info)"/>

06-25 05:07:34.557: D/SMACK(1008): 05:07:34 AM RCV (-1261183816):

      <open xmlns="[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)" block-size="4096" sid="jsi_3828818928404921117" stanza="iq"/>

06-25 05:07:34.577: D/SMACK(1008): 05:07:34 AM SENT (-1261183816):

06-25 05:07:34.657: D/SMACK(1008): 05:07:34 AM RCV (-1261183816):

 <data xmlns="[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)" seq="0" sid="jsi_3828818928404921117">

/9j/4AAQSkZJRgABAQEAYABgA

06-25 05:07:39.747: D/SMACK(1008): 05:07:39 AM RCV (-1261183816):

 <data xmlns="[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)" seq="0" sid="jsi_3828818928404921117">

/9j/4AAQSkZJRgABAQEAYABgA

06-25 05:07:44.697: D/SMACK(1008): 05:07:44 AM RCV (-1261183816):

 <close xmlns="[http://jabber.org/protocol/ibb](http://jabber.org/protocol/ibb)" sid="jsi_3828818928404921117"/>

I compare my debug with XEP-0047. I think my code suddenly stopped when sending files considering xml with ID V3rGq-7 and V3rGq-8.