Browser File Handling in SharePoint

Summary: This post explains Browser File Handling in SharePoint.

By default, when you open a PDF file from a document library, you will get the following screen (IE9):

Browser File Handling in SharePoint

This by design. A quote from Microsoft:

This is intentional behavior. In 2010 we’ve tightened up security for people with contribute access. Previously, a malicious user could upload a file with script in it that would get run as whoever browses to the page ie. an admin. In 2010 where we have a javascript object model, this would be a big problem if we didn’t have this restriction in place.


Special thanks to Jose Luis Arbelaez for pointing out the correct way for doing this.

If you want to add PDF files to be opened directly, you can use PowerShell to add the PDF file type to the AllowedInlineDownloadMimeTypes.

To do this for all Web Applications, use the following line of code:

Get-SPWebApplication | %{$_.AllowedInlineDownloadedMimeTypes.Add("application/pdf");$_.Update()}

Solution #1
This solution has to be applied for each Web Application in your SharePoint farm.

Open up Central Administration, and click Manage Web Applications.


Next, select the web application for which you want to change the Browser File Handling, and click General Settings in the ribbon. Change the Browser File Handling from Strict to Permissive and click OK.


*** NOTE *** If this does not work for you, you might want to check the Extra Information.

– Solution #2
You might have guessed it, but PowerShell also provides a solution to this. I have created a script that will set the Browser File Handling for all document libraries and lists to permissive in your SharePoint 2010 farm. This is not per Web Application. This script is available as a download in the Technet Gallery.

Extra Information

I have seen some problems with this in various environments. When you work with site / list templates, the default setting provided by the Web Application, may not be transferred when you create a new site / list based on a custom template. For this purpose, I created the script that is available for download in the Technet Gallery.

1 thought on “Browser File Handling in SharePoint

  • Nico,

    I came across this while searching for other content. I just wanted to point out that changing the file handling to permissive can be risky. believe me, that opens the door not just to PDFs but more. I have seen users invoke calls within html or text files when settings are set the way you suggest. I recommend using the following powershell script for PDF while leaving the setting ‘Strict’:

    $webApplication = Get-SPWebApplication “http:/yourwebapplicationurl”

    This is the best practice for allowing the MIME type for a PDF in a SharePoint environment

    You can find more info here:

Leave a Reply to Jose Luis Arbelaez Cancel reply

Your email address will not be published. Required fields are marked *