Save blob as File
How to save a blob in you disk as a file
// application/pdf is set as example, please set correct MIME type here
let blob = new window.Blob([blobObject], { type: 'application/pdf' });
// Parse blob object to base64 to prevent chrome blocking:
let blobUrl = URL.createObjectURL(blob);
let link = document.createElement("a"); // Or maybe get it from the current document
link.href = blobUrl;
link.download = "file";
link.innerHTML = "Click here to download the file";
// Perform click to initiate download
link.click()Last updated