Issue in loading html files in SharePoint online(modern site)

Viji Avinesh 1 Reputation point
2021-03-19T06:00:44.86+00:00

We are migrating our existing application from SP 2016 on-premise to SharePoint online. The on-prem application is having lots of FAQ/Help files added as an html file and it will get loaded to another html page through iframe. When we migrated this to online, the html is not getting rendered instead its always downloading the file. we tried to replace the html with aspx, still we are facing issue with loading the file in IFrame. Could you please help to identify a suitable workaround for this html rendering issue.

Thank and Regards

Viji Avinesh

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,212 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChelseaWu-MSFT 6,316 Reputation points
    2021-03-22T03:13:48.127+00:00

    Here are a few options:

    1. Use the sharing link for the HTML file instead of the absolute URL (which ends with .HTML). Put the file in the Site Assets library and create a sharing link for it.
    2. Use the modern Script editor web part to embed the ASPX file (as I tested HTML files get downloaded as well), or add the HTML source code directly.

    In addition, here is a relative UserVoice post you can vote for if you have the same request: Use embed code to display an html page in a SiteAssets library.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    **Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. **