NodeJS Simpan File Blob
var imageBuffer = request.file.buffer;
var imageName = 'public/images/map.png';
fs.createWriteStream(imageName).write(imageBuffer);
Jealous Jackal
var imageBuffer = request.file.buffer;
var imageName = 'public/images/map.png';
fs.createWriteStream(imageName).write(imageBuffer);
var base64Data = req.body.image.replace(/^data:image\/png;base64,/, "");
require("fs").writeFile("out.png", base64Data, 'base64', function(err) {
console.log(err);
});