# IRPCObjectOperations.UploadTempFileCommit

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Objects, versions, properties and files](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/index.md)

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

Badges: `Vault API / core` `write` `session or assertion` `idempotent`

Completes an upload made with UploadTempFile.

- **Service:** [Objects, versions, properties and files](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/index.md) `MFiles.IRPCObjectOperations`
- **gRPC method:** `/MFiles.IRPCObjectOperations/UploadTempFileCommit`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/upload-temp-file-commit`
- **Request:** [`UploadTempFileCommitRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/UploadTempFileCommit/index.md#request)
- **Response:** [`UploadTempFileCommitResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/UploadTempFileCommit/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** write
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

`logical_size` must equal the number of bytes uploaded. Otherwise the call fails with "File size
mismatch." (0x8004003D) and the server **removes the upload**, so it must be uploaded again.
Commit only once: a second commit of the same upload also fails with "File size mismatch." and
removes it. The response is empty; the upload is used by its `upload_id`.

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

## Request: UploadTempFileCommitRequest

> 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 |
|---|---|---|
| `upload_id` | `int32` | The ID from `UploadTempFile`. |
| `logical_size` | `int64` | The total number of bytes uploaded. |
| `low_digest` | `int64` | Leave 0. |
| `high_digest` | `int64` | Not checked by this method; leave 0. |

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

## Response: UploadTempFileCommitResponse

No fields.

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

## Related methods

- [UploadTempFile](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/UploadTempFile/index.md): Uploads a block of a file to a temporary upload session on the server. The upload can then be used as the content of a new object.
