whith this code :
var img = req.body.img;
var data = img.replace(/^data:image\/\w+;base64,/, "");
var buf = new Buffer(data, 'base64');
var nomeFile = Date.now()+"-"+req.session.documentoAperto+".png"
fs.writeFile('/root/appsistMe/public/AppMeFile/Utenti/'+req.session.nome+'/'+req.session.documentoAperto+'/'+nomeFile, buf);
i save a img send by the client. the problem is that the image saved weighs a lot more than the original sent by the client. there is a way to decrease the weighs of the image saved?