How to open the document on click in Sharepoint onprem in browser?

Yichen Name 86 Reputation points
2022-10-20T08:05:39.617+00:00

The URLs of SharePoint documents don't get open on click for on-prem versions 2019, 2016. They get downloaded but don't open directly on browser.
Is there a way with which we can modify the URL and use it in application so that it gets open on the browser?

E.g. If I use this "{Site Url}/Shared%20Documents/January22.pdf " as a source URL to go to the document, it is not opening in browser directly nor downloading it but, if I copy paste the URL in another tab then it gets downloaded.

Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xyza Xue_MSFT 30,176 Reputation points Microsoft External Staff
    2022-10-21T02:54:05.933+00:00

    Hi @Yichen Name ,
    You need to install Office Online Server(OOS, the next version of Office Web Apps Server) for SharePoint 2016 to open docemnrt files in the browser. I tried other methods of opening sharepoint documents in the browser on the web and they all failed.
    If you need to, please check the following link to learn how to install and configure Office Online Server.
    Configure Office Online Server for SharePoint Server 2016
    How to Install Office Online Server for SharePoint 2016
    I also found two threads with the same problem as yours, you can refer to:
    https://sharepoint.stackexchange.com/questions/266982/sharepoint-on-premise-server-2016-open-documents-in-online-mode
    https://sharepoint.stackexchange.com/questions/238574/sharepoint-2016-on-premise-force-ms-office-documents-to-open-in-browser


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.