Forum Discussion
Open HTML files in browser - SharePoint Online
I've run into this before and one fix that we came up with -- rename the file extensions from .htm or .html to .aspx. The files will then open in the browser as you expect them to.
Changing the ".html" to ".aspx" gave me the following:
Is there a way to NOT offer the Download option? This is a link to a video within training, I don't want them to be able to download the video.
- DSh13Jul 20, 2021Copper Contributor
This Microsoft article explains that you have to change some site settings and use PowerShell to effectively rename a .html file to .aspx. It also says that if you subsequently edit the file it will no longer open directly until you go through the process again. The whole purpose is to stop malicious code from being inserted on the SharePoint site and run via .html pages. https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-permissivesetting#remediation-process-for-htmlhtm-files
- DSh13Oct 27, 2021Copper ContributorSo, in early August I tried some things and got different results.
I created a page that had 3 different types of links.
• The first one links directly to a single .html file and for me opens it in the browser.
• The second one links to a document library view that only shows .html files. From that view, clicking on the file for me opens it in the browser
• The third is library web part that uses the same view that only shows .html files. From that, clicking on the file for me downloads it. - SharePointBlackBeltOct 27, 2021Copper Contributor
Just use classic view... click Return to classic SharePoint.
- jaya-pandeyOct 27, 2021Copper Contributor
Thank for your response. So if I deploy a CBT (HTML 5) training on new SP site and switch to Classic view, it would run the training?