Closed soumya-github closed 7 years ago
I'm using it this way: var buf = new Buffer(msg.payload.Body, "utf-8").toString(); msg.payload=JSON.parse(buf); return msg;
@soumya-github can you confirm the suggestion from @leonardobaiao solved your issue or not. Issue will close in 7 days otherwise.
closed due to no response
Had a similar problem while trying to upload a png file to s3. The file is in a buffer. When downloading the file the image is corrupted. Opening with a text editor shows {"type":"Buffer","data":[137,80,78,71,13,10,26,10,0,0, ...
I see that it is expected behaviour, as the documentation for put says "stringifies msg.payload and stores it in s3://buckey/key". So sorry for the comment but I'm asking myself how to write binary files.
I can't think of good a solution off the top of my head for this sorry.
One thing that might make it easier to use the uploaded file might be to base64encode the data prior to uploading, this will at least upload it in a standard encoding.
If files are downloaded using the GET method of the flow the files are getting corrupted. I tried with the below code also as said in the release. But it is not working. can you help. msg.payload=Buffer.from(msg.payload.Body).toString("utf-8")