I have .wav file, placed on "http://yy.zz/1.wav". How can i fetch it with base64 encoding on client-side javascript?
getFile('http://yy.zz/1.wav', (file) => {
console.log(getBase64File(file)); // profit
});
If the file is on the same domain or you have CORS enabled on the external site, you can do the following:
$.get("http://localhost/content/sound/hello.wav", function(file){
let fileInBase64Format = btoa(unescape(encodeURIComponent(file)));
console.log(fileInBase64Format);
});