Open HTML files in browser - SharePoint Online

Copper Contributor

I'm trying to open HTML files that are saved in a Document Library created on a Team site (using Office 365 Groups). When we add HTML files to the library they will only download and then open. We would like to be able to have these files open in the browser. Any ideas? 

42 Replies
Have you tried to show the file using a content editor webpart (classic sites)

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.

I would recommend to test carefully Kelly's approach...a regular document library is not intended in the end to serve aspx pages

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???

@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

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

@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. 

Hi @Melissa Klug,

 

Thank for the quick reply.  I appreciate the response.

 

best,

 

Rick

@Melissa Klug I had about 650 html and gif files in an old sharepoint folder (I think it was 2013 version) and it worked perfectly.  I linked a contents page to a landing page which anyone with a credentials could access.  Our IT people have discontinued that site and I am left struggling with this "new" Sharepoint.  I uploaded all of my files into a document library like I did the old one, but it won't access the images (unless I put the full path in which is absurd so instead of imgsrc="myimage.gif it now has to be imgsrc="https://MYSCHOOOL.sharepoint.com/sites/Testing123/Shared%20Documents/myimage.gif).  I also cannot navigate from page to page by clicking "next" which would load the page (like href="nextpage.html")  If I put  long file name in front of that, nothing happens.  It still does not work.

 

I have also tried changing the file extensions to aspx and that does not work either.  I need to keep using these files the way they are.  I cannot create a new page in share point for all of them.  They are all interconnected via a table of contents and it is too cumbersome to redirect all those links (even if it did work) and it is too cumbersome to have to rebuild all the pages.

 

What in the world changed?  Why can't this work like it used to????

 

Supposedly there is a way to change a setting from Strict to Permissive but nobody ever tells you where to find that setting.  I have been banging my head against a wall for six days now.  There just has to be a way forward.  I just can't believe microsoft would inflict so much pain on everyone.  If I do not fix this, my life is over.

@MothraMoon 

Hello, I was wondering if you found a solution to the problem of not being able to run a web page using (index) files in the browser?

Thank you

@Kim Rushbrooke 

Just clicking on the HTML file seems to work using Chrome but not MSIE on both Mac and Win.??

No.  It is positively the most frustrating, MADDENING experience of my entire life.  Usually I can figure this stuff out eventually.  However, I am beginning to think that THIS IS MY WATERLOO!!!!!!

 

I have noticed the pages absolutely do not open in IE.  However in Chrome and Firefox they did minus the graphic images (broken links).  It's a series of pages connected by having the user click "Next" to take them to the next page of a tutorial.  It works fine everywhere on the planet....including the old SharePoint site where it was stored for 7 years.  That came to an abrupt end (no one giving me any advance warning whatsoever).  So now I am undergoing a CRASH PANIC COURSE in how to fix this.

 

Where I am at now is that my I have to put the Long Path in so instead of 001printref.gif I have to do something like:

 

For the image

 
For the Style Sheet
 
So far so good.
 
Then, for the link to the next page in the tutorial, instead of 002printref.html
I put the long file path in like this:
 
However, instead of taking me to that next page, it downloads a copy of the page into my downloads folder on my C: drive.
 
Is there a way to make this stop??  Do I have to be an administrator to do it (like Powershell)?? 
 
WTF????????????? Am I the only person on this planet who has this problem?  You would think.
 
BTW, I am using SharePoint Online in Office 365.  I have read that there is no fix for this. But I just refuse to believe it. I don't have any Java in my web pages and there is no real classified information contained within.  It is just bogus.

@Kim Rushbrooke wrote:

@MothraMoon 

Hello, I was wondering if you found a solution to the problem of not being able to run a web page using (index) files in the browser?

Thank you



No.  It is positively the most frustrating, MADDENING experience of my entire life.  Usually I can figure this stuff out eventually.  However, I am beginning to think that THIS IS MY WATERLOO!!!!!!

 

I have noticed the pages absolutely do not open in IE.  However in Chrome and Firefox they did minus the graphic images (broken links).  It's a series of pages connected by having the user click "Next" to take them to the next page of a tutorial.  It works fine everywhere on the planet....including the old SharePoint site where it was stored for 7 years.  That came to an abrupt end (no one giving me any advance warning whatsoever).  So now I am undergoing a CRASH PANIC COURSE in how to fix this.

 

Where I am at now is that my I have to put the Long Path in so instead of 001printref.gif I have to do something like:

 

For the image

 
For the Style Sheet
 
So far so good.
 
Then, for the link to the next page in the tutorial, instead of 002printref.html
I put the long file path in like this:
 
However, instead of taking me to that next page, it downloads a copy of the page into my downloads folder on my C: drive.
 
Is there a way to make this stop??  Do I have to be an administrator to do it (like Powershell)?? 
 
WTF????????????? Am I the only person on this planet who has this problem?  You would think.
 
BTW, I am using SharePoint Online in Office 365.  I have read that there is no fix for this. But I just refuse to believe it. I don't have any Java in my web pages and there is no real classified information contained within.  It is just bogus.

[BTW, I did not mean to post this twice.  It wouldn't let me post at first.]  However, I also wanted to know how do you save html as an aspx file.  Like extremely detailed instructions.  Do I need a third party application?  I initially thought it might be as simple as opening up my html in notepad and saving as .aspx.  Apparently not because it is not working.

@MothraMoon 

 

Well you obviously have far more experience 'trouble-shooting' this issue. Its a project that must now seek alternative solutions for relating to this. I was hoping to use sharepoint so our staff could access the content I have (packaged) inside a folder with an html index file, but not this.  Thank you for the response though, I appreciate your efforts, albeit without any satisfaction. Best of luck with future efforts MonthraMoon.

@MothraMoon I am having the same issue.  I just migrated a library with an html page and it downloads rather than just opening in the browser.  I have tried setting the "Open with" to client application and browser (which would be the client application anyways) and neither make a difference.  I tried saving the file as .aspx but that did not work.  My guess is the .htm and .html files are not defined  in the search service.  On SP2013, I was able to set that it in the Search Service Application under "File Types > Manage File Types".  That option does not seem to exist in SPO.

@amwreck  Hope I am replying to the right place.

I think I have a break in the case.  It's not perfect, and it is rather cumbersome and will be a ton of, but it works.  It's better than hosting on the school's general website because I don't have access to it and I will always have to beg people to do things for me.

 

So, the thing I did was under "site pages" (on the left), clicked on that and opened a new "wiki."  I name it, then over on the upper right I click "edit."  The ribbon shows up and near the upper right I click "edit source."  From there, I just cut and paste my old html source code into the window.  You have to hit "OK" at the bottom, and then "Save" (upper left...or sometimes right).

 

This will create an aspx page which can be edited more like a word document (so the style sheet is no longer necessary).  You can string the pages together by substituting the new full link to the new sharepoint page ending in aspx.  (It seems to shorten them automatically to the root stem, but it works...such as https://MYSCHOOL.sharepoint.com/sites/nydramalibrary/SitePages/BooleanExamples.aspx  (where formely in my html site I just had to put BooleanExamples.html.  Now it shortens it automatically to just /sites/nydramalibrary/SitePages/BooleanExamples.aspx

 

Now for the photos.  I dumped them into their own document library and submitted the long file path to those.  Something like https://MYSCHOOL.sharepoint.com/sites/nydramalibrary/IL100%20Tutorials/booleanexamples.jpg  (whereas in my old site all I had to put was booleanexamples.jpg).

 

This is the only workaround I have been able to devise and like I said, it will be kind of a BE-ATCH to do for 300 html files, but at least it seems doable.

@MothraMoon  Thanks for sharing your discovery. I have (in the short term) given up on this and am now exploring our dept website.  However your solution looks intriguing so I'm gonna give it ago.  I am no expert with Sharepoint but technically minded so happy to try anything.  Thanks again for your tech.