I need to display images from the host web in an add-in, without the user necessarily having visited the host web. Is this achievable? The images are stored as item attachments in a list, and I've been using JSOM to retrieve the source url.

I've concluded that there has to be some CORS problem when I've been testing. The image sources are working, but images doesn't display until I have navigated to the host web. Any help would be really appreciated.


This issue is happening because you are directly going into the app without going into host web (access token won't be available in browser for fetching the image).

In our case, we directed the user first into the host web (to a page with script editor) and from there redirected to the app. This solved our issue.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.