IRPCObjectOperations.DownloadFile_ReadBlock

View as Markdown

Vault API / core read session or assertion idempotent

Reads a block of a file from a download session.

ServiceObjects, versions, properties and files MFiles.IRPCObjectOperations
gRPC method/MFiles.IRPCObjectOperations/DownloadFile_ReadBlock
HTTP (mf-http-grpc)POST /grpc/v1/download-file_-read-block
RequestDownloadFile_ReadBlockRequest
ResponseDownloadFile_ReadBlockResponse
Book and levelVault API, core
Kindread
SessionRequired: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
Idempotentyes
Returns metadata structure versionno
Streamingnone (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.

FieldTypeDescription
download_idint32From DownloadFile_Begin or DownloadTempFileFromUpload_Begin.
block_sizeuint32The number of bytes to read, at most 4194304 (4 MiB).
offsetint64The 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.

FieldTypeDescription
databytesThe bytes read. Shorter than block_size at the end of the file; empty past the end.