Sharepoint 2010: PDF MIME type

If you experience that you can’t open PDF documents in your browser but Sharepoint automatically tries to save te file to your local disc, run the following script in powershell:

$webApp = Get-SPWebApplication http://sharepointsite
If ($webApp.AllowedInlineDownloadedMimeTypes -notcontains “application/pdf”)
{
Write-Host -ForegroundColor White “Adding Pdf MIME Type…”
$webApp.AllowedInlineDownloadedMimeTypes.Add(“application/pdf”)
$webApp.Update()
Write-Host -ForegroundColor White “Added and saved.”
} Else {
Write-Host -ForegroundColor White “Pdf MIME type is already added.”
}