I am working on an IOT device that is sending small sound files (less then 500KB) every 10 seconds to my Meteor app which is then processing the file and sending a response back to the device. Once the response has been sent the file will be deleted from the server.
I have written the program on the IOT device in python and am using https://github.com/foxdog-studios/pyddp to communicate with Meteor via DDP. My problem is I can’t for the life of me figure out how to get a file from my IOT device to my Meteor app via DDP. I could upload the file to a folder on the server via FTP and reference it in Meteor, but that feels sloppy and extremely insecure. Any thoughts on the best way to accomplish the file upload would be much appreciated!
DDP could sent data in EJSON format. So you should just convert your file into JSON-able type and send via DDP. You can encode the file as base64 string and dencode then on the server side. For better performance you may create a custom EJSON type for binary data or just use binary options for EJSON - see the docs