Monday, December 10, 2012

Open an HTML or PDF files in SharePoint 2010


When you try to open a PDF file it prompts you to save it rather than opening.
Opening PDFs in SharePoint 2010
This is a security feature of SharePoint 2010 by design which adds headers that force the browser to download certain types of files like PDF, HTML etc. The forced download improves security for the server by disallowing the automatic execution of Web Content that contributors upload. In 2010 where we have a JavaScript Object Model, this would be a big problem if we did not have this restriction in place. This should be disabled at web application level which means across all the site collections, we cannot do at site level or site collection level.
If we disable this feature, we might have issues mainly if users try to upload HTML or other files which contain some malicious scripts.
If we want to enable this, we need to make sure that the users are not uploading any scripts (mainly Javascript) directly to Production without any testing on TEST environments.
Never fear there is a solution. It’s in central admin.Go there and click ‘Manage Web Applications’
Opening PDFs in SharePoint 2010Click on the web app you want to change, and go to ‘General Settings’
Opening PDFs in SharePoint 2010Scroll down the list until you reach ‘Browser File Handling’
Change the radio box from Strict to Permissive.
Opening PDFs in SharePoint 2010Click ok.
Go back to your PDF document and click on it – and it will open up without forcing you to save it somewhere first.




No comments:

Post a Comment