Forum Discussion
Open HTML files in browser - SharePoint Online
For those of us who are still onpremise.
Add the html mime type to the WebApplication in SharePoint and use a document library in classic mode. Not sure if Microsoft let's you do this in SharePoint Online.
You can use the script to add any mime type.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$webApp = https://yoursitename.com
function Add-SPAllowedInlineDownloadedMimeType{
[CmdLetBinding()]
param(
[Parameter(Mandatory=$true, Position=0, ValueFromPipeLine=$true)]
[Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]$WebApplication,
[Parameter(Mandatory=$true, Position=1)]
[string]$MimeType
)
process{
$actualWebApp = $WebApplication.Read()
if ($actualWebApp.AllowedInlineDownloadedMimeTypes -notcontains $mimetype)
{
Write-Host "Adding MIME Type..."
$actualWebApp.AllowedInlineDownloadedMimeTypes.Add($mimetype)
$actualWebApp.Update()
Write-Host "Done."
} Else {
Write-Host -ForegroundColor Green "MIME type is already added."
}
}
}
Add-SPAllowedInlineDownloadedMimeType -WebApplication $webApp -MimeType "text/html"