Skip to content

Instantly share code, notes, and snippets.

@victorvhpg
Created February 6, 2015 01:14
Show Gist options
  • Save victorvhpg/fa973946bd4c6bf4a643 to your computer and use it in GitHub Desktop.
Save victorvhpg/fa973946bd4c6bf4a643 to your computer and use it in GitHub Desktop.
downloadArquivo("./logo.png").then(function(arrayBuffer) {
var blob = new Blob([arrayBuffer], {
type: "image/png"
});
var img = document.createElement("img");
img.addEventListener("load", function(e) {
window.URL.revokeObjectURL(img.src);
}, false);
img.src = window.URL.createObjectURL(blob);
document.body.appendChild(img);
}).catch(function(erro) {
console.log(erro);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment