vendredi 24 septembre 2021

window.URL.createObjectURL set filename to open pdf in new tab

I want to set a custom filename in createObjectURL of the blob. Right now, its showing something like this:
<URL>/bfefe410-8d9c-4883-86c5-d76c50a24a1d

const data = window.URL.createObjectURL(newBlob);
const pdfWindow = window.open();
pdfWindow.location.href = data;

I don't want to download the file (its solution is already present on StackOverflow), it should be open in a new tab.




Aucun commentaire:

Enregistrer un commentaire