View html files in SharePoint 2021

ap 1 Reputation point
2021-12-08T15:40:22.7+00:00

I need to be able to view and share content I develop as an html file on SharePoint. The Modern Script Editor tool is not available in my organization's SharePoint, and converting the html to .aspx file does not do the trick either.

Can someone please suggest a way forward? I have an example html file here. https://www.dropbox.com/s/qwqrjttr28u25s3/example-dashboard.html?dl=0

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2021-12-09T06:10:20.717+00:00

    Hi @ap ,
    I will recommend Content Editor. Upload the html file to a document library first. Then we need to create a wiki page. Creating Content Editor and paste the html file url like following pic
    156191-image.png
    Click Apply and save the page.

    The contents of the HTML file is now displayed on the SharePoint page. You'll need to create an apsx page in this manner for each static HTML page.

    The main issue with this approach is that an .aspx file is needed to display the contents of each SharePoint HTML file. The main advantage is that it is easier to upload a HTML file to a document library than it is to upload HTML to the Site Pages library as a wiki page, and the HTML is not garbled or deleted by the SharePoint HTML cleaner. It also easily allows running JavaScript on the HTML page which is harder to do with Site Page conten


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.


    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.