We have a website integrated with SharePoint online and we are using WopiFrame.aspx page for previewing documents uploaded to the Sharepoint library. The iframe has the following url: https:///_layouts/15/WopiFrame2.aspx?sourcedoc=Documents%2fpdf-sample.pdf&file=pdf-sample.pdf&action=interactivepreview.

The page looks great and shows the data we want. However, users are not able to download the file (for example PDF) when clicking on the "Download a Copy" button.enter image description here They receive a network error (blocked by response side)

It is clear that the problem is because WopiFrame.aspx page is configured with X-FRAME-OPTIONS set to SAMEORIGIN.enter image description here

Is there a workaround? Or maybe there is a way to show the document without this menu?

1 Answer 1


I haven't tried the same before but once i had to deal with this X-Frame-Options thing. See if you can set X-Frame-Options to below for your target site. You must be able to configure this setting in IIS for your site.

X-Frame-Options: ALLOW-FROM https://example.com/

Hope that helps.

  • Thnaks Muhammad. But the problem is that this configuration has to be made on the page which I do not control. So it doesn't work because as I understand my page (where iframe is resides in) doesn't have any control over iframe's content.
    – Denis
    Commented May 30, 2017 at 9:29
  • This isn't a solution as the user cannot modify IIS settings for SharePoint Online, nor Office Online.
    – Greg W
    Commented May 31, 2017 at 3:11
  • This one is just in case he has control on the source page which he wants to show in iframe. Commented May 31, 2017 at 15:02

Your Answer

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

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