IRPCFileTransferStreaming.FileUploadBlock

View as Markdown

Vault API / standard write session or assertion client streaming

Uploads one block of a stateless file upload by streaming its data.

The file is started with FileUploadBegin, its blocks are uploaded with this method and the file is completed with FileUploadEnd (IRPCFileTransfer). The block data is sent as a stream of chunks, so neither the client nor the server needs to have the whole block in one message.

The client sends the messages in the following order:

  1. One header message.
  2. Any number of file_data messages containing the block data in order.
  3. One end message. The block is stored only when the end message has been received. If the request stream ends without the end message, the call fails and the block must be uploaded again.

The server streams the data forward with a single request while it is received. The block size is limited by the maxBlockSize returned by FileUploadBegin. Blocks may be uploaded in any order and concurrently, also to different server instances. Uploading a block again replaces it.

The data should be sent in chunks of a few megabytes at most. Each file_data message is limited by the maximum gRPC message size of the server.

ServiceStreaming file upload MFiles.IRPCFileTransferStreaming
gRPC method/MFiles.IRPCFileTransferStreaming/FileUploadBlock
HTTP (mf-http-grpc)POST /grpc/v1/file-upload-block
RequestFileUploadBlockRequest
ResponseFileUploadBlockResponse
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
Streamingclient

Remarks

Begin the upload with FileUploadBegin and follow its max_block_size and require_sequential_blocks. A block index must be less than 50,000 and a block must not be empty.

Request: FileUploadBlockRequest

A message of the FileUploadBlock request stream.

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

FieldTypeDescription
headerFileUploadBlockHeader (oneof item)The first message of the stream. Describes the block.
header.file_refstringThe file_ref received from FileUploadBegin.
header.block_indexint64The zero-based index of the block within the file, in content order. Must be less than 50 000.
header.block_sizeuint64

The size of the block data in bytes. Required.

The data must be exactly this size and must not exceed the maxBlockSize returned by FileUploadBegin.

file_databytes (oneof item)A chunk of the block data.
endFileUploadBlockEnd (oneof item)The last message of the stream. Marks the block as complete.

Response: FileUploadBlockResponse

The response of the FileUploadBlock streaming method.

No fields.