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
670 stars 96 forks source link

addFileAttachmentAsync does not work with zip.js #4172

Open pabloglombovsky opened 7 months ago

pabloglombovsky commented 7 months ago

I am trying to use zip.js and then to attach the resulting .zip file. I took this demo: https://gildas-lormeau.github.io/zip.js/demos/demo-create-file.js

addFileAttachmentAsync fails with a kind of "an internal error has occurred".

I think there are 2 internal problems here. First, the URL that I must pass to addFileAttachmentAsync (it's the URL that zip.js returns back) has this format: blob:https://www.domain.com/ and it seems that addFileAttachmentAsync does not like this format.

Second, there is a kind of permission issue in the web addin itself when running zip.js because if I manually paste the blob:https://... URL in a browser, it says 404... while if I do the same test in the same server using a standalone page then it well downloads the file. If when debugging the web addin, I use a valid blob:https://... address (that is, I pass this valid address to the addFileAttachmentAsync function) then I still get the error.

Thanks.

pabloglombovsky commented 7 months ago

one note: This happens only in Outlook desktop. In the web it works OK.