By default, most standard file types are allowed to be opened in the browser by SharePoint. However, if you wish to open a PDF, hosted in a document library, you get the dialog if you wish to either save the file or cancel. From a user experience point of view this is bad. Your end-user expects that when he/she clicks a file, he/she can work with it.
This behaviour is configured on the web application level at general settings:
Quoting SharePoint’s description:
Permissive Specifies no headers are added, which provides a more compatible user experience.
Strict Adds headers that force the browser to download certain types of files. The forced download improves security for the server by disallowing the automatic execution of Web content that contributors upload.
So changing the setting to permissive would fix things, right? Considering the fact that you disable all the headers for every file type, this is probably a bad idea.
A more secure approach would be to specifically add the PDF file extension as “allowed”. This can be done by using PowerShell. The following code snippet will allow PDF files to be opened on the web application http://sharepoint:
$webapp = Get-SPWebApplication -Identity http://sharepoint $webapp.AllowedInlineDownloadedMimeTypes.Add("application/pdf") $webapp.Update()
This method can also be used for other file types.