简体   繁体   中英

Possible to transmit files using Crossbar.io and WAMP?

Is it possible to use WAMP / Crossbar to send small simple files, such as .txt ?

At the moment, I have this snippet of tutorial code in Python:

def sendSketch(self, datastring):
    if datastring == "1":
        payload = b'1'

How can I get Python to send out files instead of just a '1'?
This is a pressing need - any help on how to do this would be greatly appreciated.

AFAIK it's not possible to send files. Your code has to get the file, encode it into something which your chosen serialization can handle (eg base64 for JSON), and the receiver then has to decode and create a file from this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM