SharePoint / OneDrive HTML File Downloads Instead of Opening? Why, and What to Do

Nick Kirtley

Nick Kirtley

11/24/2026

#sharepoint#onedrive#html#password protection
SharePoint / OneDrive HTML File Downloads Instead of Opening? Why, and What to Do

AI Summary: This article explains why an HTML file in SharePoint Online or OneDrive downloads instead of opening in the browser: Microsoft 365 uses "strict" browser file handling, which forces .html and .htm files to download, and tenants can't switch it off. It covers the common workaround of renaming files to .aspx and why it breaks (custom script is blocked by default and resets within 24 hours, and edited files stop running), why OneDrive can't serve a page either, and a practical alternative: publish the HTML report on a static host such as 99helpers behind a password.


Need the report viewable today? Publish the HTML file on 99helpers, add a password, and share the link with your team.

Someone exports a report as HTML (doesn't matter what kind of file): a test run, or an analytics summary, or an e-learning module, or a dashboard an AI tool built. It goes into a SharePoint document library or a OneDrive folder (which a company typically has to share things when using Microsoft tools), the link goes out to the team, and everyone who clicks it gets a download instead of a page that they can actually see and use.

This has been one of the most asked questions on the Microsoft Tech Community since a 2017 thread that is still collecting replies. The short version: it's by design, and the workarounds are fragile.

Why SharePoint downloads HTML files instead of opening them

SharePoint has a setting called browser file handling, with two modes for the setting. In "permissive" mode an HTML file in a library opens and runs in the browser. In "strict" mode, risky file types such as HTML are downloaded or shown as raw content instead of being run. Microsoft's guidance on moving from permissive to strict explains that strict is the default for SharePoint Online and that every tenant still on permissive was switched to strict by 31 December 2018. Microsoft's migration documentation says it plainly: in SharePoint Online, strict is enforced and can't be changed, and .htm and .html files in document libraries no longer open in the browser.

The reason is security (and the fact that web pages can be abused by users). A page can contain JavaScript, and a script uploaded by one contributor would run with the permissions of whoever opens it. So Microsoft sends the file as a download (using a Content-Disposition header) rather than as a page.

Why OneDrive doesn't open HTML files either

OneDrive for work or school is built on SharePoint, so the same rules apply. Shared HTML files download, or the person you shared with ends up looking at the source code. In a Microsoft Q&A thread about sharing a folder with an index.html, the accepted answer was to zip the files and have the recipient unzip and open them locally. Another reply put it simply: OneDrive is not a web server. And it was never designed to be a web server, rather it's more of a sharing and archiving tool.

The .aspx workaround, and why it keeps breaking

The fix most often suggested is to rename report.html to report.aspx. SharePoint treats .aspx files as pages, so a renamed file can open in the browser. It comes with conditions that make it hard to rely on:

  • Custom script must be allowed on the site. Modern team and communication sites, OneDrive and sites created in the admin center block it by default. An admin can allow it with Set-SPOSite <SiteURL> -DenyAddAndCustomizePages 0, but Microsoft's page on allowing or preventing custom script says this is now overridden back to "Not allowed" within 24 hours. It also says custom script can't be allowed on an individual OneDrive.
  • The right person has to upload it. Microsoft notes that a rename by someone with only Edit permission leaves the file marked as non-executable, so it downloads anyway.
  • Every edit breaks it again. Editing the renamed file marks it non-executable once more, and the process has to be repeated.

On top of that, allowing custom script is a real security decision. Microsoft points out that script added to a site can't be audited or blocked once it's allowed. In 2024, admins on Microsoft Q&A reported .aspx files uploaded after a certain date suddenly downloading instead of opening, which is exactly the kind of surprise you don't want with a report the leadership team opens every Monday.

For a single page in a tenant you control, the .aspx route can work. For reports regenerated every week, or shared outside the team, it doesn't hold up.

The fix: publish the HTML report as a page, with a password

What you actually need is static file hosting: a service that serves HTML as a web page. The catch for a business report is that it mustn't be public. 99helpers does both: your HTML opens as a page at its own address, and on paid plans you can put a password in front of it.

  1. Go to 99helpers and drop in the HTML file. If the report has separate images, CSS or JavaScript, drop the whole folder or a .zip with index.html at the top level.
  2. Choose an address, such as q3-report.99helpers.site.
  3. Turn on password protection and set a password.
  4. Share the link and the password with your team, ideally through different channels.

Anyone with both sees the report rendered in their browser, on desktop or phone, with no download and no Microsoft account, so clients and partners outside your tenant can open it too.

When the report is regenerated, publish the new version to the same address. The link you already shared shows the latest version, and earlier versions are kept so you can roll back. See hosting a report online for more on report-specific setups.

Is a password enough for internal data?

Be clear about the difference. SharePoint ties access to individual Microsoft 365 accounts. A password-protected link is a shared secret: anyone who has the link and the password can view it. That's the right fit for project dashboards, status reports, test results and training material. For regulated or highly confidential data, check what your company's policy allows before you move it outside Microsoft 365.

SharePoint vs 99helpers for HTML reports

What you needSharePoint / OneDrive99helpers
HTML opens as a pageNo, downloads (strict file handling)Yes
Images, CSS and JavaScript loadOnly after a local downloadYes, from your folder or zip
Works without admin changesNo, needs custom script and site-owner rightsYes
Keep it privateMicrosoft 365 permissionsPassword protection on paid plans
Share outside your organizationNeeds guest accessLink plus password
Update without breaking the linkThe .aspx trick breaks on editPublish to the same address

Frequently asked questions

Can a SharePoint admin switch HTML files back to opening in the browser?

No. Microsoft moved every SharePoint Online tenant to strict browser file handling by the end of 2018, and it can't be changed. The only in-SharePoint option is the .aspx rename with custom script allowed, which now resets within 24 hours.

How much does password protection cost on 99helpers?

Publishing an HTML file is free. Password protection comes with the paid plans, starting with Starter, and every paid plan has a 7-day money-back guarantee. See the pricing for details.