using Javascript to Save base64 image to File Path

Viewed 1682

I have a base64 image string generated from a Signature panel. Now I want to get the base64 string to be converted to an Image and saved to a file Path Maybe on Drive C:\images How can I do something like this

function SaveBase64toImagePath(){

document.form1.base64TextString.value += obj.imageData;
var base64string = document.form1.base64TextString.value;

var fullString = '<img src="data:image/png;base64,+ base64string + " alt="">';

...

save to directory
}
1 Answers

try es6 templates with ${variable};

var fullString = `<img src="data:image/png;base64${base64string}" alt="">`;

and then you can save image from img tag

JavaScript: Create and save file

Related