0
I’m creating a feature similar to the email attachment, in which we attach files but if we want to view it to confirm the files to be sent we download.
That’s where I’m having the problem
function abrirArquivo() {
var decoded = $base64.decode(base64);
var url = window.URL.createObjectURL(new Blob([decoded], {type:"image/png"}));
var link = document.createElement('a');
link.href = url;
link.setAttribute('download', "teste");
document.body.appendChild(link);
link.click();
}
I use the function above that picks up the base64
from the image I want to download, converts to binary and passes to the constructor of the Blob
, but when the download ends the image opens with error: