def on_message(self, headers, body):
        if 'filename' in headers:
            content = base64.b64decode(body.encode())
            if os.path.exists(headers['filename']):
                fname = '%s.%s' % (headers['filename'], int(time.time()))
            else:
                fname = headers['filename']
            with open(fname, 'wb') as f:
                f.write(content)
            self.__print_async("MESSAGE", headers, "Saved file: %s" % fname)
        else:
            self.__print_async("MESSAGE", headers, body)
See :py:meth:`ConnectionListener.on_message`
dataset/ETHPy150Open jasonrbriggs/stomp.py/stomp/__main__.py/StompCLI.on_message