4

We are trying to show images stored in SharePoint sub-site, on an external internet facing public website. We are currently trying to use an external accessible link from SharePoint to show the image on the public website. We then created an HTML image tag on the external website and set its “src” attribute to the SharePoint’s externally accessible link. Something like the following Example https://mycompany.sharepoint.com/sites/images/webimages/myimage.png'/>

However this does not seem to work for me. I have made sure that SharePoint allows external Sharing of individual files. See image below

External sharing in SharePoint

I have also tested that I can generate an external link of an image, send it to external user who is able to open the link and see that image. See image below.

Generation an external link

The issue we are facing is that the externally accessible link gives us a URL for a SharePoint Out-of-the-Box webpage which have options like "Show original", "Download", etc. instead of the link to the actual image which is required to render the image in the external website. Furthermore when I click “Show Original” option the webpage opens the actual image ('https://mycompany.sharepoint.com/sites/images/webimages/myimage.png’). However when I ask the external user to access the link it redirects them to Microsoft Office login page.

I am struggling to find a solution to this. I was wondering if anyone has faced this problem and knows a solution for it. If not then does anyone knows of any work around to Use SharePoint/One Drive for generating links so that they can be used/embedded in external websites.

Any help is appreciated. Thanks In Advance

2 Answers 2

4

This scenario is not supported. There is no way to host images in SharePoint Online and make them accessible on another site via an img Html tag. The direct link to an image will require authentication. The generated external sharing link will redirect you to the SharePoint page, not the image file itself.

As an option, you can host images in Azure Blob storage.

8
0

The correct html code format for embed image should be like

<img src = "https://<tenant>.sharepoint.com/sites/site/library/Name.png">

It doesn’t accept guest link generated by SharePoint Online.

OneDrive is similar to SharePoint site, which doesn’t support embed image using a guest link either.

Even if you get the embed image to display on the external website, it will remain invisible for unauthorized users since it requires permission to see the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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