IRPCObjectOperations.DownloadFile_ReadBlock
Vault API / core read session or assertion idempotent
Reads a block of a file from a download session.
| Service | Objects, versions, properties and files MFiles.IRPCObjectOperations |
|---|---|
| gRPC method | /MFiles.IRPCObjectOperations/DownloadFile_ReadBlock |
| HTTP (mf-http-grpc) | POST /grpc/v1/download-file_-read-block |
| Request | DownloadFile_ReadBlockRequest |
| Response | DownloadFile_ReadBlockResponse |
| Book and level | Vault API, core |
| Kind | read |
| 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) |
Remarks
block_size is at most 4 MiB (4194304 bytes); a larger value fails with "The parameter is
incorrect. (Block size exceeded the limit of 4194304 bytes.)". The server returns block_size
bytes, or fewer at the end of the file; an offset at or past the end returns no data. Blocks can
be read in any order and read again.
When the last block has been read and the file was read in order from offset 0, the server closes the download session; a later read fails with "Not found. (The specified download session <id> does not exist.)". Otherwise close it with DownloadFile_Stop.
The session also serves the downloads opened by DownloadTempFileFromUpload_Begin.
Request: DownloadFile_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 | From DownloadFile_Begin or DownloadTempFileFromUpload_Begin. |
block_size | uint32 | The number of bytes to read, at most 4194304 (4 MiB). |
offset | int64 | The byte offset to read from. |
Response: DownloadFile_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; empty past the end. |
Related methods
- DownloadFile_Stop -- Closes a download session.
- DownloadTempFileFromUpload_Begin -- Opens a download session for a committed upload, to read it back or as a PDF, without creating an object.
- DownloadFile_Begin -- Opens a download session for a file version and returns its ID, the content size and, on request, its MD5 checksum.
- DownloadFile -- Not available over native gRPC: the server answers "Not implemented.". Used by the M-Files HTTP gateway.