1

I am using MS Wopi when the file is open for the view so how to remove the edit option as seen in the image.Image

1 Answers1

0

I have done something like this,

You can have Edit and View separate in the View. So I have passed some parameters with the session context in WOPI action URL to identify what is the operation.

Ex: https://{_baseUrl}/wopi/files/{combinedDocumentId}?sc=<your value>&wopisrc={wopiHostUrl}

By checking that you can get value inside the Session Context with,

Request.Headers["X-WOPI-SessionContext"]

Keep in mind this value comes with Base64 encoded.

Then you need to decode it and pass it to the GetFileInformation function.

With that, you can set,

ReadOnly = true

UserCanWrite = false

for disabling edit on that iframe.