Converting an image to base64 in angular 2, image is uploaded from local . Current am using fileLoadedEvent.target.result. The problem is, when I send this base64 string thr
Have you tried using btoa or Crypto.js to encode the image to base64 ?
link to cryptojs - https://code.google.com/archive/p/crypto-js/
var imgSrcData = window.btoa(fileLoadedEvent.target.result);
or var imgSrcData = CryptoJS.enc.Base64.stringify(fileLoadedEvent.target.result);
var imgSrcData = CryptoJS.enc.Base64.stringify(fileLoadedEvent.target.result);