title: Node.js Base64 Image decoding and writing to file
body: <p>I'm sending the contents of this Flex form (Don't ask why) over to node. There is a post paramteter called "photo" which is a base64 encoded image.</p>
  
  <p>Contents of photo get sent over ok. Problem is when I am trying to decode the content and write them to a file.</p>
  
  <pre><code>  var fs = require("fs");
  
    fs.writeFile("arghhhh.jpg", new Buffer(request.body.photo, "base64").toString(), function(err) {});
  </code></pre>
  
  <p>I've tried toString("binary") as well. But it seems node doesnt decode all of the content. It seems it only decodes jpg header info and leaves the rest.</p>
  
  <p>Can anyone please help me with this?</p>
  
  <p>Thanks</p>