none
Page Viewer Web Part in SharePoint Online forcing users to download HTML file instead of displaying HTML content on the page

    Question

  • On my previous SharePoint site (which was built within a SharePoint 2007 environment), I created a page that included the Page Viewer web part to display an interactive diagram for end users. I did so by following these steps:

    1. Upload the HTML assets to the Site Assets library2. Create a Page Viewer Web Part on a new web part page to display this HTML content
    3. Configure the Page Viewer Web Part by going to Edit Web Part > Page Viewer > Web Page and then select the path to the HTML content (which was uploaded to the Site Assets Library as noted in Step 1).


    This worked as intended on SharePoint 2007- the HTML content appears on the page for end users to view via the Page Viewer Web Part.

    However, this exact same set of steps in SharePoint Online doesn't work. When users try to view the page that includes this Page Viewer Web Part, users are prompted with message as noted below. Basically, the web part isn't displaying the HTML content on the page - it's forcing the user to download the HTML file that the Page Viewer Web Part is pointing to.

    Tuesday, April 19, 2016 1:56 PM

Answers

  • As per my understanding MS never allowed opening HTML file directly in the browser for SharePoint Online. If you go to site assets library and try to open the HTML file from there it will still download. This is to avoid any security issues related to JavaScript in HTML file.

    If possible, try changing the .html extension to .aspx. That should likely work.

    • Marked as answer by ryan.mcdonald Tuesday, April 19, 2016 5:12 PM
    Tuesday, April 19, 2016 2:44 PM
    Moderator

All replies

  • As per my understanding MS never allowed opening HTML file directly in the browser for SharePoint Online. If you go to site assets library and try to open the HTML file from there it will still download. This is to avoid any security issues related to JavaScript in HTML file.

    If possible, try changing the .html extension to .aspx. That should likely work.

    • Marked as answer by ryan.mcdonald Tuesday, April 19, 2016 5:12 PM
    Tuesday, April 19, 2016 2:44 PM
    Moderator
  • Changing the .html extension to .aspx worked. Thanks for the tip!
    Tuesday, April 19, 2016 5:13 PM