# IRPCSharedLinksPublic.DownloadSharedFile_ReadBlock

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/DownloadSharedFile_ReadBlock/

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

Reads one block of a file download started with DownloadSharedFile_Begin.

- **Service:** [Shared links (anonymous access)](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/index.md) `MFiles.IRPCSharedLinksPublic`
- **gRPC method:** `/MFiles.IRPCSharedLinksPublic/DownloadSharedFile_ReadBlock`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/download-shared-file_-read-block`
- **Request:** [`DownloadSharedFile_ReadBlockRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/DownloadSharedFile_ReadBlock/index.md#request)
- **Response:** [`DownloadSharedFile_ReadBlockResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/DownloadSharedFile_ReadBlock/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

- No session is needed. `access_key` must be the key that started the download; another key
  fails with "The link is either expired or invalid.".
- `block_size` can be at most 4 MiB (4 194 304 bytes). Read until you have `file_size` bytes; a
  block can be shorter than requested. See
  [Files](https://developer.m-files.com/APIs/gRPC-API/runtime/files/index.md) for block sizes and
  message size limits.

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

## Request: DownloadSharedFile_ReadBlockRequest

> 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 |
|---|---|---|
| `vault` | `string` | The vault GUID. |
| `access_key` | `string` | The access key that started the download. |
| `download_id` | `int32` | The `download_id` from DownloadSharedFile_Begin. |
| `block_size` | `uint32` | The number of bytes to read, at most 4 194 304. |
| `offset` | `int64` | The position in the file to read from. |

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

## Response: DownloadSharedFile_ReadBlockResponse

> 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 |
|---|---|---|
| `data` | `bytes` | The bytes read. |

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

## Related methods

- [DownloadSharedFile_Begin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinksPublic/DownloadSharedFile_Begin/index.md): Starts downloading the file of a shared link, without logging in, and returns a download ID, the file size and its MD5 checksum.
