Reputation: 11
I'm working on WOPI integration with one of our internal tools and I'm stuck with one issue while saving documents in client.
I was able to set up ClientUrl to a GET method that returns file contents as "application/octet-stream". After that, by clicking "Edit in Word", Word opens successfully with needed document. But I can save only a copy of document locally.
I implemented methods for the same URL not only for GET, but POST and PUT also, and was hoping that Word will try to save this file by calling them with file contents, but currently I can't even save from Word.
I want to implement same functionality as SharePoint/OneDrive has, that allow me to save opened document directly to the server.
Can please some one help me with this?
Upvotes: 0
Views: 1851
Reputation: 7696
Depending on whether you are integrating with Office Online Server 2016 or Office Web Apps 2013 you should refer to the new or the old documentation respectively.
To successfully implement the "Save" operation, you have to:
SupportsUpdate
to true
in CheckFileInfo
PutFile
(mandatory) and PutRelativeFile
(optional, used for creating new files, not necessarily required for updating)SupportsCobalt
and SupportsCoauth
capabilities of CheckFileInfo
to true
SupportsLocks
and implement the corresponding methodsIf you need some examples, search GitHub for ms-wopi
tag.
If you want to support updating from the desktop version of MS Word, that's a whole different story. You need to look somewhere else - it can be accomplished by implementing WebDAV (an extension on top of HTTP). Not unlike MS-WOPI, it's a quite complex protocol. I'd recommend using an external library, such as WebDAV server from IT Hit. That should make your life easier.
Upvotes: 2