3.3.5.1.15 PutRelativeFile

Create a new file on the WOPI server based on the current file.

HTTP Verb: POST

URI: HTTP://server/<...>/wopi*/files/<id>?access_token=<token>

The request message for this operation contains the following HTTP headers.

Request header

Usage

Value

X-WOPI-Override

A string specifying the requested operation from the WOPI server. Required.

The string "PUT_RELATIVE".

X-WOPI-SuggestedTarget

A UTF-7 string specifying either a file extension or a full file name.

If only the extension is provided, the name of the initial file without extension SHOULD be combined with the extension to create the proposed name.

The WOPI server MUST modify the proposed name as needed to create a new file that is both legally named and does not overwrite any existing file, while preserving the file extension.

This header MUST be present if X-WOPI-RelativeTarget is not present.

A string that is a file extension or a full file name.

X-WOPI-RelativeTarget

A UTF-7 string that specifies a full file name. The WOPI server MUST NOT modify the name to fulfill the request. When a file with the specified name already exists, if the X-WOPI-OverwriteRelativeTarget request header is set to false, or if the X-WOPI-OverwriteRelativeTarget request header is set to true and the file is locked, the host MUST respond with a 409 status code.

A string that is a full file name.

X-WOPI-OverwriteRelativeTarget

A Boolean value that specifies whether the host MUST overwrite the file name if it exists.

A Boolean value.

X-WOPI-Size

An integer that specifies the size of the file in bytes.

An integer.

The response message for this operation can contain the following HTTP headers.

Response header

Usage

Value

X-WOPI-ValidRelativeTarget

A UTF-7 string provided by the WOPI server that the WOPI client can use as the value of X-WOPI-RelativeTarget in a future PutRelativeFile operation.

This header SHOULD only be included when responding with the 409 status code if a file with the specified name already exists.

A string.

The response message for this operation can result in the following status codes.

Status code

Description

200

Success

400

Specified name is illegal

401

Token is invalid

404

File unknown/User unauthorized

409

Target file already exists or the file is locked;

413

File is too large. The maximum size is implementation-specific.

500

Server error

501

Unsupported