Jul 10 2018 02:07 AM - edited Jul 10 2018 05:26 AM
We try to embed SharePoint content in an iFrame. Therefore we use the GUID of the doc to build the ifram URL.
([[HOST]]_layouts/15/WopiFrame.aspx?sourcedoc={[[GUID]]}&action=embedview&wdStartOn=1)
Tested with 3 different files.
Working fine.
Iframe-URL is
https://..._layouts/15/WopiFrame.aspx?sourcedoc={cfca68b9-c498-4c9b-a790-52d0f522b684}&action=embedview&wdStartOn=1
Everything is working fine. Preview is available.
Iframe gets blocked.
Iframe-URL is
https://..._layouts/15/WopiFrame.aspx?sourcedoc={51bf3f39-addc-48aa-b9a0-7bd1b56d9f07}&action=embedview&wdStartOn=1
Browser shows the following message:
Refused to display 'https://..._layouts/15/WopiFrame.aspx?sourcedoc={51bf3f39-addc-48aa-b9a0-7bd1b56d9f07}&action=embedview&wdStartOn=1' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
Its exactly the same URL as before, just the query parameters are different (different GUIDs).
When URLs get opened directly in the browser, you can see a small redirect.
The PPTX gets redirected to https://xyz.sharepoint.com/:p/r/sites/.../_layouts/15/WopiFrame.aspx?....
The XLS gets redirected to https://xyz.sharepoint.com/:x/r/sites/.../_layouts/15/WopiFrame.aspx?....
QUESTION: Why does it get handled differently? How can we get the .xls to show up?
Iframe gets blocked.
Iframe-URL is
https://..._layouts/15/WopiFrame.aspx?sourcedoc={c967893a-26e4-45d9-876b-8d77d7575cc2}&action=embedview&wdStartOn=1
"Refused to display 'https://.../Shared Documents?RootFolder=%2Fsites%2Fsmarterpathtestingsite%2FShared Documents' in a frame because it set 'X-Frame-Options' to 'sameorigin'."
As it seems the URL doesnt work at all, it redirects to the Folder-View of that Sharepoint-Site. The same behavior when the URL gets opened up in the browser directly.
QUESTION: Is there any way to embed a PDF like this? In our local Dev environment it was working fine.
Jul 10 2018 02:33 AM
Jul 10 2018 05:26 AM
We are having a SharePoint Online Add-In, it is not about integrating in SharePoint sites.
Dec 04 2018 12:34 AM
Use interactivepreview action option.
Example:
Mar 29 2021 05:22 AM - edited Mar 29 2021 05:25 AM
@Linda Werner Have you tried this? And if yes, is it working??