How to Open a PDF File in a Browser Using a PowerShell Command in SharePoint 2010

In SharePoint 2010, most users cannot open the PDF file in a browser when clicking on the Name column. This blog post will give you a tip on how to open a PDF file in a browser using a PowerShell command.

A PDF file has been saved to the Shared Documents library. Since this file is a security risk, the browser cannot open when downloading a PDF stored in the library using the ‘Save’ button.

Go to your server, open SharePoint 2010 Management Shell, then Run as Administrator:

Enter the following commands into the form:

$webApp = Get-SPWebApplication(“http://yourservername”)

$webApp.AllowedInlineDownloadedMimeTypes.Add(“application/pdf”)

$webApp.Update()

$webApp.AllowedInlineDownloadedMimeTypes

After that, you can return to your site in the browser and open the PDF file once again.

Questions about how to open a PDF file in a browser using a PowerShell Command? Contact us or check out our online documentation!