How to Activate MIME Type using Powershell

  •  
  •  
  •  
  •  
  •  
  •  

$mime = “text/html”
$webAppUrl = “http://test.company.com”
$webApp = Get-SPWebApplication $webAppUrl

If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains $mime)
{
Write-Host -ForegroundColor White “Adding MIME Type “$mime
#$webApp.AllowedInlineDownloadedMimeTypes.Add($mime)
#$webApp.Update()
Write-Host -ForegroundColor Green “MIME Type added and saved.”
}
Else
{
Write-Host -ForegroundColor Yellow $mime” MIME type is already added.”

}

About Vishal Geet

Experienced Senior Technical Project Manager with a demonstrated history of working in the information technology and services industry. Skilled in SharePoint Technology, Requirements Analysis, Oracle Database, IT Strategy, Project Management and Data Warehousing.

View all posts by Vishal Geet →

Leave a Reply

Your email address will not be published.

five × three =