BlogPost

I hit a problem where I would like to add my adobe edge projects or .HTML files to my SharePoint pages but every time I added the code snippet the IE would ask me to save the index.html file, PROPER ANOYIING!! Click the continue reading button and I will go through the steps taken to solve this…

Adding Mimetypes in SharePoint



So after reading this article I had a much better understanding on why they prevented untrusted html files but I still wanted to run my custom html files through the SharePoint pages, I suppose there is two steps to this blog, how to build and where to place the html files or adobe edge project files what to do from a admin perspective to get this working, I have classified this blog under admin and I will look towards documenting the HTML page.


Step One

Log onto your SharePoint server (preferably dev) to start and open up the SharePoint Admin console (for a FARM environment you will only need to this on the server which the admin console is installed on in my case App1)

Step Two

Add

                                                
    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." 
        } 
    } 
} 

Then Add

Add-SPAllowedInlineDownloadedMimeType -WebApplication https://YourDomainName.com -MimeType "text/html"

Completion

To when you add a .HTML file or adobe project to your code snippets or linked files from SharePoint it will now work.