title: POST an image and display it in dashboard in Node-red
body: <p>My goal is to send a picture via POST request in Python and to display it in a dashboard in Node Red, but I'm stuck in the step of reading the image once it's been sent. </p>
  
  <p>This is the piece of code I'm using to send the file:</p>
  
  <pre><code>directory = os.path.join(DIRECTORY_IMAGES, id)
  files = {'image': open(directory,'rb')}
  requests.post('http://XXX.XXX.X.XX:1880/IMAGE', files = files)
  </code></pre>
  
  <p>Once in Node-red, the blocks I'm using are the following:</p>
  
  <p><a href="https://i.stack.imgur.com/B1ddA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B1ddA.jpg" alt="enter image description here"></a></p>
  
  <p>The message is received, but I'm unable to get the picture out of it. As I've read in other posts the <code>msg.payload</code> is set to <code>req.files[0].buffer</code>, encoded as <code>Base64</code> and displayed using <code>&lt;img width="16" height="16" src="files:image;base64,{{msg.payload}}" /&gt;</code> in a template, but that does not display the image. </p>
  
  <pre><code>[{"id":"797939a8.a91a58","type":"http response","z":"ddfa6621.2e7168","name":"","statusCode":"","headers":{},"x":1290,"y":2280,"wires":[]},{"id":"d5b145ce.a712f8","type":"ui_template","z":"ddfa6621.2e7168","group":"9beeae56.34305","name":"Display image","order":4,"width":"7","height":"6","format":"&lt;img width=\"16\" height=\"16\" src=\"files:image;base64,{{msg.payload}}\" /&gt;\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1680,"y":2220,"wires":[[]]},{"id":"5e30e496.958b9c","type":"change","z":"ddfa6621.2e7168","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"req.files[0].buffer","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1300,"y":2220,"wires":[["2f260e60.d12642"]]},{"id":"2f260e60.d12642","type":"base64","z":"ddfa6621.2e7168","name":"Encode","x":1500,"y":2220,"wires":[["d5b145ce.a712f8"]]},{"id":"18c71628.986f4a","type":"http in","z":"ddfa6621.2e7168","name":"","url":"IMAGE","method":"post","upload":true,"swaggerDoc":"","x":1050,"y":2220,"wires":[["5e30e496.958b9c","797939a8.a91a58"]]},{"id":"9beeae56.34305","type":"ui_group","z":"","name":"Última pierna procesada","tab":"223d38a0.9cbaa8","order":8,"disp":true,"width":"7","collapse":false},{"id":"223d38a0.9cbaa8","type":"ui_tab","z":"","name":"CALIDAD PULPAS CINTA 0","icon":"dashboard","disabled":false,"hidden":false}]
  </code></pre>
  
  <p>What am I missing?</p>