I have base64 data URL in my angularJs controller, and I need an image file from that, so that I could send it to server as multi-part data through ajax?
I'm looking for something like file writer in angularjs. Can anyone help me please?
you can generate blob from base64 data.
var imageBase64 = "image base64 data";
var blob = new Blob([imageBase64], {type: 'image/png'});
From this blob, you can generate file object.
var file = new File([blob], 'imageFileName.png');
You can use this file object and post it to server using multipart data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With