Ok so I have a Blob
file that I'm trying to save on local disk (the Blob
is created locally from an ArrayBuffer
). The problem I'm facing is that Outlook for macOS does not want to open a FileSaverDialog
or something similar to let the user save the file.
My code is working perfectly in Outlook for Web (OWA) on all browsers (including Safari) and Outlook for Windows.
const blob = new Blob([body]); //body is an ArrayBuffer created locally const link = document.createElement('a'); if (link.download !== undefined) { const url = URL.createObjectURL(blob); link.setAttribute('href', url); link.setAttribute('download', fileName); link.style.visibility = 'hidden'; document.body.appendChild(link); link.click(); document.body.removeChild(link); }
PS: I have tried using window.open(blob);
, but Outlook for macOS throws an error in that situation: "There is no application set to open URL blob:https://..."
PS 2: I have also tried using Office.context.ui.displayDialogAsync(url, { height: 100, width: 100, requireHTTPS: true });
,but still getting the same error.
How am I supposed to prompt a SaveFileDialog
for the user ? Thank you in advance