Displaying PDFs in the browser from Sharepoint 2010

 Computer, Sharepoint, Software  Comments Off on Displaying PDFs in the browser from Sharepoint 2010
Oct 052011
 

If you have a default SharePoint 2010 setup you would notice that when you go to open a PDF file SharePoint prompts you to save it rather than opening.

The cause of this behavior is SharePoint 2010 Browser File Handling. This property is on SharePoint Web Application level and its value determines how files are treated in the browser. “Strict” specifies that MIME content types which are not listed in “AllowedInlineDownloadedMimeTypes” are forced to be downloaded. “Permissive” specifies that the HTML and other content types which might contain script are allowed to be displayed directly in the browser.

“AllowedInlineDownloadedMimeTypes” is a collection of MIME types. This list of MIME types does not contain MIME type of Pdf documents by default. It is important to understand that by adding Pdf MIME type to IIS settings you will not solve this issue.

Solution Part 1:
The solution is to change Browser File Handling property on Web Application level. For that you need to be a Farm Administrator. Steps to change Browser File Handling property:
Go to SharePoint 2010 Central Administration > Application Management > Manage Web Applications
Select the row of your web application
Click General Settings in the ribbon
Scroll down to Browser File Handling and select Permissive
Click Ok

Solution Part 2:
You may still get prompted to open PDFs with the Client Application. Adding the MIME type will allow you to open the PDF in the browser.
Here is a Powershell script to affect this.

$mimetypes = “application/pdf”,
$webApp = Get-SPWebApplication http://portal

foreach($mime in $mimetypes)
{
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.”
}
}
After executing this script, you have to restart your IIS in order this setting to get active: iisreset /noforce.

Error adding PerformancePoint content to Web Part Page

 Computer, Sharepoint, Software  Comments Off on Error adding PerformancePoint content to Web Part Page
Sep 192011
 

There is now a HotFix that addresses this issue:

http://support.microsoft.com/kb/2597936

Original  Post:

Came across an odd bug when adding PerformancePoint content to a standard Web Part Page.



“The selection is not a valid PerformancePoint” whatever…
Took my a while to realize that for some reason the Location path was using the PerformancePoint item link:
/lists/PerformancePoint Content/dispform.aspx?id=XXX

The actual path should be:
/lists/PerformancePoint Content/XXX_.000.

Not sure why Sharepoint inserts the former URL instead of the latter. You can see what the path should be in the selection dialog box.