I have a Buffer that has the contains a PDF that I have not been able to successfully download. Every time I attempt to open the PDF, it fails to open. Here is the code I am using to download the file:
const content = new Blob(attach.content.data, { type: attach.contentType });
const encodedUri = window.URL.createObjectURL(content);
const link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", attach.filename);
link.click();
Here is what the attach object looks like: 
Here is what the Blob looks like: 
Halp, plx!!!1
Aucun commentaire:
Enregistrer un commentaire