Important update note - Please read:
“For web applications that need to serve untrusted HTML files, we have introduced a mechanism to help prevent the untrusted content from compromising your site’s security. When the new X-Download-Options header is present with the value noopen, the user is prevented from opening a file download directly; instead, they must first save the file locally. When the locally saved file is later opened, it no longer executes in the security context of your site, helping to prevent script injection.”
Go to Central Administration > Manage Web Applications > [Highlight a web application] > click General Settings in the Ribbon > Scroll down in the General Settings window to see Browser File Handling. Set as desired. Save settings.
Craig Lussier edited Revision 14. Comment: updated article for SharePoint 2013 and added management function download links
Craig Lussier edited Revision 13. Comment: modified typo
Craig Lussier edited Revision 12. Comment: modified code formatting
Craig Lussier edited Revision 11. Comment: added toc and modified headings
Craig Lussier edited Revision 10. Comment: code formatting
Craig Lussier edited Revision 9. Comment: yet another code formatting change
Craig Lussier edited Revision 8. Comment: added text
Craig Lussier edited Revision 7. Comment: modified and added text
Good explanation of MIME
The PowerShell for adding MIME type - application/pdf to content web applications is especially helpful. Opening PDFs in the browser is a common user request. I had read previously that you were forced to use Permissive in order to allow this... It is good to know that you can leave handling as Strict yet still allow PDFs.
Great article, thanks! In the section on adding a trusted MIME type to a specific app, though, there is a typo in the second line: $webAppApplication.... has an extra "App". Remove that and you'll stop getting "You cannot call a method on a null-valued expression."
I wasn't aware of this article till just now but what an excellent write-up. Very educational.
Deep Dives are always appreciated. Wish their were many many more of them.
At long last, after MUCH searching, the answer is delivered. Thank you beyond measure!
Thanks for the detailed description. I have a problem in opening pdf document directly in IE10 but I am able to open them in Chrome. I have added "application/pdf" as trusted MIME type to the SharePoint web application. I can see that response headers in both IE and Chrome do not contain “X-Download-Options: noopen”. Are you aware of any specific setup for IE10?
-Thanks,
Gaurav