# IRPCSharedLinksPublic.UploadSharedFile

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) > [Shared links (anonymous access)](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/index.md)

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

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

Uploads a block of new content for a file opened for editing in Office for the web. Used by
M-Files clients; applications rarely call it.

- **Service:** [Shared links (anonymous access)](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/index.md) `MFiles.IRPCSharedLinksPublic`
- **gRPC method:** `/MFiles.IRPCSharedLinksPublic/UploadSharedFile`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/upload-shared-file`
- **Request:** [`UploadSharedFileRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/UploadSharedFile/index.md#request)
- **Response:** [`UploadSharedFileResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/UploadSharedFile/index.md#response)
- **Book and level:** Vault API, standard
- **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

- Works only with links of type `SHARED_LINK_TYPE_WOPIEDIT`; other links fail with "The
  parameter is incorrect.".
- Start with `upload_id` 0 and `offset` 0, then send the following blocks with the returned
  `upload_id`. Finish with
  [UploadSharedFileCommit](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/UploadSharedFileCommit/index.md).

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

## Request: UploadSharedFileRequest

> 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 |
|---|---|---|
| `guid_vault` | `string` | The vault GUID. |
| `access_key` | `string` | The access key of the editing link. |
| `upload_id` | `int32` | 0 for the first block; then the `upload_id` that the first call returned. |
| `additional_data[]` | repeated [`NamedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.NamedValue/index.md) | Optional named values. Can be empty. |
| `additional_data[].key` | `string` | The name of the value. |
| `additional_data[].value` | [`TypedValue`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValue/index.md) | The value as a serialized bytearray. |
| `additional_data[].value.is_null_value` | `bool` | True if the value is empty. `data` is then unset. |
| `additional_data[].value.type` | [`Datatype`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.Datatype/index.md) | The data type of the value. |
| `additional_data[].value.data` | [`TypedValueUnion`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.TypedValueUnion/index.md) | The value, in the member that matches `type`. Unset for an empty value. |
| `total_size_in_bytes` | `int64` | The total size of the file. Read only with the first block (`offset` 0). |
| `offset` | `int64` | The position of this block in the file. Use multiples of 4096 bytes. |
| `data` | `bytes` | The bytes of this block. |

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

## Response: UploadSharedFileResponse

> 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 upload ID to use for the following blocks and the commit. |

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

## Related methods

- [UploadSharedFileCommit](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/UploadSharedFileCommit/index.md): Completes an upload made with UploadSharedFile and stores the content in the checked-out file. Used by M-Files clients; applications rarely call it.
