Skip to content

voplica.types.file.upload

The protobuf package voplica.types.file.upload: 0 services, 2 messages and 3 enums, defined in voplica/types/file/upload/file_upload.proto.

Field Number Type Label Description
file_id 1 string
file_size 2 int64
uploaded_bytes 3 int64
status 4 FileUploadStatus
file_type 5 voplica.types.base.FileType
mime_type 6 voplica.types.base.MimeType
created_at 7 int64
upload_expires_at 8 int64
owner_id 9 string
chunk_size 10 int64
upload_type 11 FileUploadType
file_name 12 string optional Optional initial file name used for file upload (example: hello.png)
message 13 string optional Optional error message
asset_id 14 string optional Default asset id of the uploaded file Usable only if FileUploadStatus is COMPLETED
asset_type 15 voplica.types.base.AssetType optional
purpose 16 FileUploadPurpose Why the file was uploaded. Controls visibility in “My Files” + cleanup eligibility. Defaults to PRIMARY (normal, visible, permanent).
Field Number Type Label Description
file_id 1 string ID of the file upload process
upload_expired_at 2 int64 If the file is not uploaded till this time - it will be automatically discarded. Quota is not released for discarded files.
chunk_size 3 int64 Minimum amount of bytes that must be sent in a single request, except the last chunk. Last chunk can be smaller than the chunkSize. We must always send full chunks. Chunks cannot be sent partially. We can send multiple chunks together (including all chunks in a single request). Example: fileSize = 1024 bytes chunkSize = 100 bytes We can send next requests: Request 1 - /upload - offset: 0, content-length: 500 (i.e. 5 chunks) Request 2 - /upload - offset: 500, content length: 524 (i.e. 6 chunks. Notice the last chunks is smaller - which is fine). Wrong! - /upload - offset: 0, content-length: 524 - this will fail because 6th chunk is not complete and it’s not the last chunk.
upload_type 4 FileUploadType
Name Number Description
FILE_UPLOAD_PURPOSE_UNSPECIFIED 0
PRIMARY 1 Normal, user-visible, permanent upload. This is the default for all regular user uploads (documents, generation reference images, etc.).
SUPPORTING_METADATA 2 A transient file acting like metadata for some job. It is hidden from “My Files” and eligible for cleanup. For example, inpainting/editing mask image (the Editor “Dream” flow). It is uploaded only so generation workflows can resolve it as InpaintParams.mask_image;
Name Number Description
FILE_UPLOAD_STATUS_UNSPECIFIED 0
UPLOADING 1 File upload was initialized and the file transfer is in progress.
PROCESSING 2 The file was successfully uploaded and is now being processed. I.e. the file is being converted, indexed, or otherwise prepared for use.
COMPLETED 3 The file upload and processing were completed successfully. The file is now available for use.
FAILED 4 The file upload or processing failed. The file is not available for use, and an error message may be provided.
CANCELLED 5 The file upload was canceled by the user or the system. Usually occurs when the user decides to stop the upload before it is completed, or the system determines that the upload is expired or invalid. The file is not available for use, and no further processing will occur.
Name Number Description
FILE_UPLOAD_TYPE_UNSPECIFIED 0
SIMPLE 1 SIMPLE type refers to cases when the file is uploaded in a single request. Only small files can be uploaded in a single request.
MULTIPART 2 MULTIPART type refers to cases when the file is uploaded in multiple requests (chunked upload)