Forum Discussion
Open HTML files in browser - SharePoint Online
We have and that works but one of our users has a library with over 30 html files that he would like to be able to click on in the library and then just open in the browser instead of having to set up a page for each one.
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.
- Murray50May 14, 2021Copper Contributor
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.
- Dvik_11Sep 07, 2020Copper Contributor
Deleted
Thanks for the solution.
in Sharepoint online site,I changed my video file from .htm to .aspx and it is working as well,but in same time the blank.htm file is also downloaded,how can we prevent this downloading,please suggest.
- DeletedSep 07, 2020
Hi Dvik_11 - I don't have a suggestion for the blank.htm download file you're seeing. We haven't seen that with ours.
- LiasGallardoJan 31, 2018Copper Contributor
Deleted thanks for the tip Kelly, this worked perfectly in a document library. I only had to rename the index-home file to aspx and the rest of the files displayed correctly in the browser. Used for html5 video training
- jaya-pandeyFeb 23, 2021Copper Contributor
I saw you response on how you opened HTML5 video file on SP 365. I also have a training created in Articulate Story which is in html format. when I change the extension to .aspx then it doesn't work. Am I doing it correct? Thanks in advance for your help.
- Melissa KlugNov 27, 2017Copper Contributor
It looks like on the Team Sites made with Office 365 groups the files were changed to .aspx when I added them to the library and they still open as an attachment. I'm thinking we're going to have to find another way to do this. Any ideas if there may be support for this in the future???
- Rick SegalMar 19, 2019Brass Contributor
Hi Melissa Klug
Were you ever able to solve this problem. I've got the same problem. On a modern site document library.
thx,
Rick
- Melissa KlugMar 19, 2019Copper Contributor
Rick SegalWe had to create a classic 2013 site to get this to work which was not ideal since they wanted to use the Modern View for the library.
- Nov 23, 2017I would recommend to test carefully Kelly's approach...a regular document library is not intended in the end to serve aspx pages