'Receive next portion of incoming datastream and store it write
it to temporary file. Used internally.'

def ReceiveHandler(self, conn, stanza):

    (sid, seq, data) = (stanza.getTagAttr('data', 'sid'), stanza.getTagAttr('data', 'seq'), stanza.getTagData('data'))
    self.DEBUG(('ReceiveHandler    called    sid->%s    seq->%s' % (sid, seq)), 'info')
    try:
        seq = int(seq)
        data = base64.decodestring(data)
    except:
        seq = ''
        data = ''
    err = None
    if (not (sid in self._streams.keys())):
        err = ERR_ITEM_NOT_FOUND
    else:
        stream = self._streams[sid]
        if (not data):
            err = ERR_BAD_REQUEST
        elif (seq != stream['seq']):
            err = ERR_UNEXPECTED_REQUEST
        else:
            self.DEBUG(('Successfull    receive    sid->%s    %s+%s    bytes' % (sid, stream['fp'].tell(), len(data))), 'ok')
            stream['seq'] += 1
            stream['fp'].write(data)
    if err:
        self.DEBUG(('Error    on    receive:    %s' % err), 'error')
        conn.send(Error(Iq(to=stanza.getFrom(), frm=stanza.getTo(), payload=[Node((NS_IBB + '    close'))]), err, reply=0))
