I’m writing a macro plugin that wants to work with page attachments on the client side. I’ve already set up an atlas-connect environment, but I stuck with this problem.
What I’ve done so far:
- Using an attachment parameter I get the name of an attachment.
- Using the
/rest/api/content/<pageId>/child/attachmentcall I get the download url for the attachment. These are looking someting like this:
- I can download attachment on the server side by sending a requests with the url above.
The problem is that it doesn’t work on the client side (the view for the macro). If I try to download attachment with full url (like
https://username.atlassian.net/wiki/download/attachments/12345/filename.png) I get a CORS error that doesn’t allow me to download the file.
I can workaround it by downloading the file on the server side, and then serving the downloaded content to the client side, but in this case I have to download everything twice.
Do you have any idea how to solve this?