title: convert a base64 image string to a image file that can be served to browsers using node.js
body: <p>The issue was to do with the HTTP ACCEPT header not being accepted by Restify, the image rendering code is fine. </p>
  
  <hr>
  
  <p>I have an image encoded as a base64 string, and I want to serve this as an image using node.js. Currently I've got the following code (I'm using Restify) which renders the image in Chrome OK, but the image doesn't render in other browsers (tried IE9, Firefox 4, Android browser):</p>
  
  <pre><code>var decodedBuffer = new Buffer(dataString,"base64");            
      res.send({
            code: 200,
            headers: {'Content-Type': 'image/png', 'Content-Length': decodedBuffer.length},   
            noEnd: true                               
      });     
  
      res.write(decodedBuffer);                       
      res.end();  
  </code></pre>
  
  <p>Anyone able to shed some light on what I might be doing wrong??</p>
  
  <p>Thanks</p>