OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
669 stars 95 forks source link

Outlook Online, addFileAttachmentAsync does not work for inline bitmap (.bmp) images #4693

Open DmitryKostochko opened 1 month ago

DmitryKostochko commented 1 month ago

We are developing an Outlook add-in for compose mode. The addFileAttachmentAsync method does not work when trying to attach a bitmap image (.bmp) with { isInline: true }.

Your Environment

Expected behavior

The addFileAttachmentAsync method shall work.

Current behavior

The following error is returned: { "status": "failed", "error": { name": "Internal Error", "message": "An internal error has occurred." } }

Steps to reproduce

  1. Sign in to Outlook Online.
  2. Create a new message.
  3. Open the add-in’s pane and execute the following code: Office.context.mailbox.item.addFileAttachmentAsync('https://online-addins.ablebits.com/testaddin/image.bmp', 'image.bmp', { isInline: true }, (result) => { console.log(result); });

Pay attention to the Console tab, you will see the error there.

kumarshrey-msft commented 1 month ago

I observe the issue is not with the URI but rather with the attachment name parameter on Outlook Web, the same code with "image.png" instead of "image.bmp" as attachment name succeeds on Outlook Web for the same bmp-uri string. Thanks for reporting this issue, we have been able to reproduce it and it has been put on our backlog. We unfortunately have no timelines to share at this point.

Internal tracking id: 292566