0

I want to implement a web add-in feature to download base64 encoded data. This works for OWA and windows client, but does not work in outlook on mac.

Can you explain how to download any base64 encoded data in outlook on mac?

Tested variants

FileSaver.js

<IconButton
  iconProps={{ iconName: 'Download' }}
  onClick={() => {
    FileSaver.saveAs(data, filename);
  }}
/>

Works on windows and OWA, but not in outlook on mac.

Object URL with Link

<a href={URL.createObjectURL(blobObject)} download={filename}>download</a>

Works on windows and OWA, but not in outlook on mac.

Data URL with Link

<a href={`data:;base64,${data}`} download={filename}>download</a>

Works on windows and OWA, but not in outlook on mac.

openBrowserWindow

I also tried to open a browser windown containing a data url

Office.context.ui.openBrowserWindow(`data:;base64,${data}`)

or a url created by URL.createObjectURL()

Office.context.ui.openBrowserWindow(`blob:https://localhost:3000/<uuid>`)

URL.createObjectURL() should not work, because if the use defined an other default browser than safari, this link is invalid.

Additionally openBrowserWindow() only works with urls starting with http:// or https://. URLs starting with data: or blob: are not recognized and does not open a new new browser window.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
Xeras
  • 3
  • 2
  • Can you please provide a script lab snippet for what you have tried. It will be good for us to understand the issue. – Outlook Add-ins Team - MSFT Sep 29 '22 at 03:54
  • Unfortunately not, the behavior of script is not identical to an outlook add-in. You can create a new add-in using yeoman generator and paste `download` in the app component. – Xeras Sep 29 '22 at 12:58
  • Script lab provides an iframe which contains the script. When you insert the provided download a-element, the content opens in the iframe and the download attribute is ignored. When you insert the a-element within an addin, the content does not open in the same window and the download attribute is ignored aswell. – Xeras Sep 29 '22 at 13:34

0 Answers0