Thursday 15 December 2011

Open PDF in Browser Not Working

In Sharepoint 2010 you can change the Web Application settings so PDFs open in the browser. You can do this in Central Admin, Manage Web Applications. Select the Application and then click on General Settings. In the Browser File Handling section you can change the settings to be Permissive.
























Once this change is made it should work but you may still have a problem with sites that have been created from a template. You can run this script to update these sites to Permissive which will then fix all of the remaining sites.

$site = Get-SPSite(“http://siteurl")
foreach ($web in $site.AllWebs) {
    Write-Host "Inspecting " $web.Title
    foreach ($list in $web.Lists) {
        if($list.browserfilehandling -eq "Strict") {
            Write-Host "Changing " $list.Title
            $list.browserfilehandling = "Permissive";
            $list.update();
            $site.url,
            $list.title,
            $list.browserfilehandling
        }
    }
}
 
 
 

No comments:

Post a Comment