IRPCFileTransfer.FileUploadBegin
Vault API / standard write session or assertion
Begins an upload in blocks and returns its file_ref and the block rules.
| Service | Stateless file upload sessions MFiles.IRPCFileTransfer |
|---|---|
| gRPC method | /MFiles.IRPCFileTransfer/FileUploadBegin |
| HTTP (mf-http-grpc) | POST /grpc/v1/file-upload-begin |
| Request | FileUploadBeginRequest |
| Response | FileUploadBeginResponse |
| Book and level | Vault API, standard |
| Kind | write |
| Session | Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata). |
| Idempotent | no |
| Returns metadata structure version | no |
| Streaming | none (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.
| Field | Type | Description |
|---|---|---|
total_size_in_bytes | int64 | The 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.
| Field | Type | Description |
|---|---|---|
file_ref | string | Identifies the upload in FileUploadBlock, FileUploadEnd, FileUploadAttach and the other methods that take an uploaded file. |
max_block_size | int64 | The maximum size of one block in bytes. |
require_sequential_blocks | bool | True 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. |
Related methods
- IRPCFileTransferStreaming.FileUploadBlock -- Uploads one block of a stateless file upload by streaming its data.
- FileUploadEnd -- Completes an upload in blocks. Binds the content to no object; use FileUploadAttach or AddObjectWithFiles for that.