title: How to decode image in node js with using bodyparser
body: <p>I have tried decode image file in node js with body parser in and uploaded to server url. but I didn't get success in uplaod and parser image with base64 image.</p>
  
  <pre><code> if (req.method === 'POST') {
      //base64_decode(req.body.profileImg, 'copy.jpeg');
      //console.log(req.body.profileImg);
      var NewImageName =  Math.random().toString(36).substring(7);
      var imageBuffer = decodeBase64Image(req.body.profileImg);
      fs.writeFile('../assets/images/seller/'+NewImageName+'.png', imageBuffer.data, function(err) {
  
      });
  </code></pre>