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) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo