Hello
My name is Vitor and I'm a newbie
Well... I'm trying post an image(base64) but I'm doing something wrong.
Can anybody help me?
PS.: ( Yes, my english is terrible and I love emojis )
[{"id":"2c5d9a9a.f66d76","type":"debug","z":"52ff64e1.2eeebc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"statusCode","targetType":"msg","statusVal":"","statusType":"auto","x":580,"y":4100,"wires":[]},{"id":"7063876c.369298","type":"inject","z":"52ff64e1.2eeebc","name":"","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"str","x":90,"y":4040,"wires":[["cf4aa127.19db"]]},{"id":"cf4aa127.19db","type":"http request","z":"52ff64e1.2eeebc","name":"","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://dummyimage.com/200x150/000/fff&text=test","tls":"","persist":false,"proxy":"","authType":"","x":230,"y":4040,"wires":[["fe2cfe82.0ce1d"]]},{"id":"fe2cfe82.0ce1d","type":"base64","z":"52ff64e1.2eeebc","name":"","action":"str","property":"payload","x":380,"y":4040,"wires":[["41666478.0efc7c"]]},{"id":"41666478.0efc7c","type":"function","z":"52ff64e1.2eeebc","name":"","func":"//var encoded = Buffer.from(msg.payload).toString(\"base64\");\n//var decoded = Buffer.from(msg.payload, \"base64\").toString();\n//msg.payload[0] = encoded;\n//msg.payload[0] = encoded;\n//msg.payload=msg.payload\n//msg.body=msg.payload\n// 'multipart': true\n\nmsg.headers = {\n// 'content-type': 'text/json',\n// 'content-type': 'application/x-www-form-urlencoded',\n// 'Content-Type':'multipart/form-data;boundary=\"\"',\n// 'Content-Type': 'text/plain; charset=\"ISO-8859-1\"', \n// 'Content-Type': 'text/plain;base64', \n// 'Content-Type': 'text/html', \n// 'Content-transfer-encoding': 'base64'\n }\n// msg.payload = \"\";\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":200,"y":4100,"wires":[["2367a688.225b3a","c13969e6.fb19a8"]]},{"id":"a6c3ae0f.4fa7c","type":"http in","z":"52ff64e1.2eeebc","name":"","url":"/files","method":"post","upload":true,"swaggerDoc":"","x":80,"y":4160,"wires":[["9a27df8c.73c74","14def71.1a47b09","332ab622.ceb2ca"]]},{"id":"fae2a83a.9340c8","type":"http response","z":"52ff64e1.2eeebc","name":"","statusCode":"","headers":{},"x":430,"y":4160,"wires":[]},{"id":"9a27df8c.73c74","type":"debug","z":"52ff64e1.2eeebc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":230,"y":4200,"wires":[]},{"id":"2367a688.225b3a","type":"http request","z":"52ff64e1.2eeebc","name":"http test","method":"POST","ret":"txt","paytoqs":"ignore","url":"http://localhost:1880/files","tls":"","persist":false,"proxy":"","authType":"","x":380,"y":4100,"wires":[["2c5d9a9a.f66d76"]]},{"id":"14def71.1a47b09","type":"change","z":"52ff64e1.2eeebc","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"okay","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":4160,"wires":[["fae2a83a.9340c8"]]},{"id":"332ab622.ceb2ca","type":"image","z":"52ff64e1.2eeebc","name":"","width":160,"data":"payload","dataType":"msg","thumbnail":true,"active":true,"pass":true,"outputs":1,"x":260,"y":4240,"wires":[[]]},{"id":"c13969e6.fb19a8","type":"image","z":"52ff64e1.2eeebc","name":"","width":160,"data":"payload","dataType":"msg","thumbnail":true,"active":true,"pass":true,"outputs":1,"x":600,"y":4140,"wires":[[]]}]
Thanks in advance!!!!!