IRPCFileTransfer.FileUploadBegin

View as Markdown

Vault API / standard write session or assertion

Begins an upload in blocks and returns its file_ref and the block rules.

ServiceStateless file upload sessions MFiles.IRPCFileTransfer
gRPC method/MFiles.IRPCFileTransfer/FileUploadBegin
HTTP (mf-http-grpc)POST /grpc/v1/file-upload-begin
RequestFileUploadBeginRequest
ResponseFileUploadBeginResponse
Book and levelVault API, standard
Kindwrite
SessionRequired: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
Idempotentno
Returns metadata structure versionno
Streamingnone (unary)

Remarks

Upload the blocks with FileUploadBlock, each at most max_block_size bytes; all blocks but the last must be exactly max_block_size bytes when require_sequential_blocks is true. Then call FileUploadEnd.

A file has at most 50,000 blocks. If total_size_in_bytes is larger than 50,000 times the maximum block size, the call fails with ERROR_FILE_TOO_LARGE. Event handlers of the vault can cancel the upload here; the call then fails with their error.

Request: FileUploadBeginRequest

Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

FieldTypeDescription
total_size_in_bytesint64The size of the whole file in bytes, if known; 0 if not. If set, the ended upload must have exactly this size.

Response: FileUploadBeginResponse

Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

FieldTypeDescription
file_refstringIdentifies the upload in FileUploadBlock, FileUploadEnd, FileUploadAttach and the other methods that take an uploaded file.
max_block_sizeint64The maximum size of one block in bytes.
require_sequential_blocksboolTrue if the blocks must be uploaded in order, one at a time, and every block but the last must be max_block_size bytes. False if blocks can be uploaded in any order and concurrently, also through different server instances.