javascript - How to send a base64 image to node js server -


i know how retrieve base64 image canvas using javascript on html page:

var url =  canvas.todataurl("image/png");    url.replace(/^data:image\/(png|jpg);base64,/, "");  

now want send information server , create image. want like:

router.post('/createimage', function (req, res) {      var base64image = //i need base64 image here      var picpath = path.normalize('./public/images/users/pic.png');      fs.writefile(picpath, url, 'base64', function(err) {       console.log(err);     }); }); 

how can that?


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -

Apache NiFi ExecuteScript: Groovy script to replace Json values via a mapping file -