# IRPCTest.UploadTestFile_Begin

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) > [Connection and health checks](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/index.md)

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

Badges: `Vault API / standard` `write` `session` `idempotent`

Starts an upload whose bytes the server discards, for measuring upload throughput.

- **Service:** [Connection and health checks](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/index.md) `MFiles.IRPCTest`
- **gRPC method:** `/MFiles.IRPCTest/UploadTestFile_Begin`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/upload-test-file_-begin`
- **Request:** [`UploadTestFile_BeginRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/UploadTestFile_Begin/index.md#request)
- **Response:** [`UploadTestFile_BeginResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCTest/UploadTestFile_Begin/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

Needs a vault session. Without a session the call fails with `UNAUTHENTICATED`; a server-level
session fails with `E_MFILES_LOGIN_REQUIRED`.

The response's `upload_id` is always -1, which tells the upload methods to accept the bytes and
store nothing. Nothing is created, so there is nothing to clean up:

1. Call this method; it returns `upload_id` -1.
2. Send the blocks with
   [UploadTempFile](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/UploadTempFile/index.md), each with `upload_id` -1,
   `total_size_in_bytes` and the `offset` of the block, and time those calls. Each call succeeds
   and returns `upload_id` 0; keep using -1.
3. Optionally finish with
   [UploadTempFileCommit](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/UploadTempFileCommit/index.md) with
   `upload_id` -1, as a real upload would.

Use the block size your application uses for real uploads, so that the measurement matches.

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

## Request: UploadTestFile_BeginRequest

> 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 |
|---|---|---|
| `file_size` | `int64` | The planned size of the test upload. |

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

## Response: UploadTestFile_BeginResponse

> 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` | Always -1. Pass it to `UploadTempFile` and `UploadTempFileCommit`. |

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

## Related methods

- [IRPCObjectOperations.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.
- [IRPCObjectOperations.UploadTempFileCommit](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCObjectOperations/UploadTempFileCommit/index.md): Completes an upload made with UploadTempFile.
