# IRPCWOPIOperationsPublic.WOPIUploadFileCommit

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Server integration API](https://developer.m-files.com/APIs/gRPC-API/integration/index.md) > [WOPI operations (anonymous)](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFileCommit/

Badges: `Server integration API / specialized` `internal: not for applications` `write` `no session`

Stores an upload made with WOPIUploadFile as the new content of the file of the WOPI session.

- **Service:** [WOPI operations (anonymous)](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/index.md) `MFiles.IRPCWOPIOperationsPublic`
- **gRPC method:** `/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFileCommit`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/wopiupload-file-commit`
- **Request:** [`WOPIUploadFileCommitRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFileCommit/index.md#request)
- **Response:** [`WOPIUploadFileCommitResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFileCommit/index.md#response)
- **Book and level:** Server integration API, specialized
- **Kind:** write
- **Session:** Not needed: the call can be made before logging in.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

**For M-Files components only.** The M-Files WOPI service calls it at the end of a save from
Office for the web. Applications should not call it.
- Changes the file content of the object. The object must be checked out, the token's link must
  be for editing or co-authoring, and the token's user needs read and edit access.
- Fails with "File size mismatch." when the uploaded byte count differs from
  `total_size_in_bytes` of the first upload call. The upload is deleted after the commit, also
  when the commit fails.

<a id="request"></a>

## Request: WOPIUploadFileCommitRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `wopi_user_session_key` | `string` | The WOPI user session token. |
| `upload_id` | `int32` | The ID from [WOPIUploadFile](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFile/index.md). |
| `low_digest` | `int64` | If not zero, the first 8 bytes of the MD5 checksum of the uploaded file, as a little-endian integer. |
| `high_digest` | `int64` | If not zero, the last 8 bytes of the MD5 checksum, as a little-endian integer. |

<a id="response"></a>

## Response: WOPIUploadFileCommitResponse

No fields.

<a id="related"></a>

## Related methods

- [WOPIUploadFile](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCWOPIOperationsPublic/WOPIUploadFile/index.md): Uploads a block of the new content of the file of a WOPI editing or co-authoring session.
