Hi, I'm having a bit of a problem posting data to a REST API.
I can't post the data as buffer, I have to post it as a string.
This has led up to some testing.....
I'm trying to open a locally stored PDF by using the "file-in" node.
I'm fetching the content as "single buffer object" I then try to convert the buffer to string by using buffer.toString(), tested this by using encoding utf-8 and latin1, after that I write the string to a destinationfile. The thing is that the destinationfile is destroyed and I can't really get what I have to do to keep the string intact, I guess something gets destroyed when converting to string.
Anyone with ideas or input on this?
pasting sample flow:
[{"id":"9495208.57a77e","type":"file in","z":"f94d5a4b.3ceeb8","name":"getFile","filename":"example_2page.pdf","format":"","chunk":false,"sendError":false,"encoding":"utf8","x":2050,"y":1060,"wires":[["53811629.bd5098"]]},{"id":"7febb7ef.2189d8","type":"file","z":"f94d5a4b.3ceeb8","name":"saveTo","filename":"example_2page_copy.pdf","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":2350,"y":1060,"wires":[]},{"id":"e153c330.00e75","type":"inject","z":"f94d5a4b.3ceeb8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1890,"y":1060,"wires":[["9495208.57a77e"]]},{"id":"53811629.bd5098","type":"function","z":"f94d5a4b.3ceeb8","name":"","func":"msg.payload = msg.payload.toString('latin1');\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2150,"y":960,"wires":[["7febb7ef.2189d8"]]}]