write file from blob nodejs code example
Example 1: nodejs save blob file
var imageBuffer = request.file.buffer;
var imageName = 'public/images/map.png';
fs.createWriteStream(imageName).write(imageBuffer);
Example 2: nodejs save blob file
var base64Data = req.body.image.replace(/^data:image\/png;base64,/, "");
require("fs").writeFile("out.png", base64Data, 'base64', function(err) {
console.log(err);
});