# IRPCScheduledJobsAdmin.DownloadScheduledJobOutputFile_ReadBlock

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Scheduled jobs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/index.md)

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

Badges: `Administration API / specialized` `admin` `session` `idempotent`

Reads a block of a job output file, such as the summary of a restore from archive preview.

- **Service:** [Scheduled jobs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/index.md) `MFiles.IRPCScheduledJobsAdmin`
- **gRPC method:** `/MFiles.IRPCScheduledJobsAdmin/DownloadScheduledJobOutputFile_ReadBlock`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/download-scheduled-job-output-file_-read-block`
- **Request:** [`DownloadScheduledJobOutputFile_ReadBlockRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/DownloadScheduledJobOutputFile_ReadBlock/index.md#request)
- **Response:** [`DownloadScheduledJobOutputFile_ReadBlockResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCScheduledJobsAdmin/DownloadScheduledJobOutputFile_ReadBlock/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **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

- The `download_id` comes from the call that produced the file, for example
  `RestoreFromArchiveResponse.download_idsummary` of
  [RestoreFromArchive](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultAdmin/RestoreFromArchive/index.md) with `preview_only`.
- Read from offset 0 onwards until a block is shorter than requested. The server then deletes
  the download session; it also deletes it when a read fails. An unknown or finished
  `download_id` fails with "Not found. (The specified download session ... does not exist.)".
- `block_size` is at most 4 MiB. Only the session that started the download can read it.
- Requires the vault rights `archive` and `restore_from_archive`, or `manage_scheduled_jobs`
  (in a server-level session, `manage_jobs`).

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

## Request: DownloadScheduledJobOutputFile_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 |
|---|---|---|
| `download_id` | `int32` | The download session ID returned by the call that produced the file. |
| `block_size` | `uint32` | The number of bytes to read, at most 4194304. |
| `offset` | `int64` | The byte offset to start reading from. |

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

## Response: DownloadScheduledJobOutputFile_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; shorter than `block_size` at the end of the file. |

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

## Related methods

- [IRPCVaultAdmin.RestoreFromArchive](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultAdmin/RestoreFromArchive/index.md): Imports the contents of an archive (or one object of it) into the vault, or previews the import.
