Creates a new file on the host based on the current file.
This operation works as follows:
Name | Description | Type |
file_id | The file ID that must be URL safe. | string |
Name | Description | Type |
access_token | An access token that the host will use to determine whether the request is authorized. | string |
Name | Description | Type | Presence |
X-WOPI-Override | The requested operation from the WOPI server (PUT_RELATIVE). | string | required |
X-WOPI-SuggestedTarget | A file extension or a full file name, including the file extension in the format of the UTF-7 encoded string. | string | required |
X-WOPI-Size | The size of the file in bytes. | integer | optional |
X-WOPI-FileConversion | Indicates that the request is being made in the context of binary document conversion. | boolean | optional |
The request body must contain the full file contents in the binary format.
Name | Description | Type | Presence |
X-WOPI-Lock | The lock ID identifying the current lock on the file. This header must always be included when responding to the request with 409 Conflict. It should not be included when responding to the request with 200 OK. | string | optional |
X-WOPI-LockFailureReason | The cause of the lock failure. This header may be included when responding to the request with 409 Conflict. It must only be used for logging purposes. | string | optional |
Name | Description | Type | Presence |
Name | The file name, including extension, without a path. | string | required |
Url | URI of the form http://server/<...>/wopi/files/(file_id)?access_token=(access token), of the newly created file on the host. | string | required |
HostViewUrl | URI to a host page that loads the view WOPI action for the newly created file. | string | optional |
HostEditUrl | URI to a host page that loads edit action for the newly created file. | string | optional |
Starting from version 8.1, the Save Copy As functionality is added to the WOPI protocol through the PutRelativeFile operation. In the ONLYOFFICE Docs API, this action is implemented as the onRequestSaveAs event.
When the PutRelativeFile operation is executed to save a copy of the current file, the X-WOPI-FileConversion header is not sent in the request.
To restrict the Save Copy As functionality, set the UserCanNotWriteRelative property in CheckFileInfo to true.