Displaying Sharepoint images in Perspective

I would like to display images from Sharepoint into Perspective somehow. With the end goal being that users of the Perspecive app can take a photo on their device, and upload it to Sharepoint via their REST API.

Initial tests haven't worked out so well though using an "Image" component as well as trying to display something in the "backgroundImage" style property.

I am trying to generate a "public read-only" Sharepoint URL from the uploaded image.
The link has the following format:
https://REDACTED.sharepoint.com/:i:/s/Public/ETc5iZ9BG5NDkfgqMudsjbIBL_IIVmNXdzhxMbSMzPzL-Q
Which i supposed doesn't end in .png or anything image related.

But it does work when opened in a browser. Although the final url does change..

Is there anyway to get a direct link somehow that actually works with Perspective?
I suspect its going to be another case of Microsoft just doing things bad and making life difficult..

Clicking on the image itself on Sharepoint opens it in a browser with the following URL, which i could use in Perspective..

https://REDACTED.sharepoint.com/sites/Public/Shared%20Documents/tempPictures/Peformance-Dashboard.png

Next is to figure out if i can get this direct link in some sort of automated fashion..

You may need help from your Sharepoint administrator, as you will have trouble with cross-domain resource limitations. The key phrase to search is "Content Security Policy", both for Perspective and for Sharepoint.

Opening something in another tab is entirely different from embedding something in your own site's content.

2 Likes