Stateless file upload sessions (IRPCFileTransfer)

View as Markdown

Stateless file upload. No method requires a sticky session.

The file_ref identifies state in Master Storage, not in an MFServer process, so any server instance can serve any call.

The file data is sent with the hand-written client-streaming methods of IRPCFileTransferStreaming in mfiles.filestreaming.proto, as the IDL supports only unary methods:

gRPC serviceMFiles.IRPCFileTransfer
Book and levelVault API, standard
Methods3
Proto filemfiles/IRPCFileTransfer.proto

Overview

Uploads identified by a file_ref string instead of an upload ID. Together with IRPCFileTransferStreaming, which carries the data, this service is an alternative to the upload sessions of UploadTempFile and UploadFile.

Availability. Stateless uploads are switched off by default in M-Files Server 26.11: every method of this service and of IRPCFileTransferStreaming then answers "Not implemented.", and ServerVaultCapabilities file_upload_stateless_supported is false. Check that capability first; when it is false, upload with UploadTempFile and UploadTempFileCommit instead. See Files.

Two ways to upload.

Using the upload. An ended upload is used by its file_ref: as the content of an existing file of a checked-out object with FileUploadAttach, in the file_ref field of the uploaded-file sources of AddObjectWithFiles, with DownloadTempFileFromUpload_Begin, and as OCR input in IRPCScanningAndOCR.

Where the upload is stored. This depends on where the vault keeps its file data, and decides what FileUploadBegin returns:

Vault file data file_ref Blocks Served by
Master Storage a GUID up to the Master Storage single request limit, any order any server instance
Azure Blob Storage a GUID up to the Blob Storage block size (4 MiB by default), any order any server instance
Disk or database the upload ID in decimal up to 4 MiB, in order the server and login session that began it

In the last case the upload is an upload session as with UploadTempFile: it is bound to the login session and the server instance, and anonymous sessions cannot upload.

Methods

MethodSummaryFacts
FileUploadAttachStores an ended upload as the new content of an existing file of an object that is checked out to the caller.write session or assertion returns metadata structure version
FileUploadBeginBegins an upload in blocks and returns its file_ref and the block rules.write session or assertion
FileUploadEndCompletes an upload in blocks. Binds the content to no object; use FileUploadAttach or AddObjectWithFiles for that.write session or assertion