Class UploadRecord
Represents what an IUploadStore keeps of an upload from its creation: its ID, its owner, its length and chunk size, its creation time and the service's metadata.
Namespace: Singulink.Net.Http.Api.Service.Uploads
Assembly: Singulink.Net.Http.Api.Service.dll
Syntax
public sealed class UploadRecord
Constructors
| Name | Description |
|---|---|
| UploadRecord(string, string, long, int, DateTime, string, string?) | Initializes a new instance of the UploadRecord class. |
Properties
| Name | Description |
|---|---|
| ChunkCount | Gets the number of chunks, which is 0 for an empty file. |
| ChunkSize | Gets the chunk size in bytes. Every chunk has this length, except the last, which has the rest of the file. |
| CreatedUtc | Gets the time the upload was created, in UTC. |
| Id | Gets the upload ID: 256 random bits as 43 base64url characters, unique across users. |
| IdempotencyKey | Gets the idempotency key that is reserved for the upload (see ReserveKeyAsync(string, string, string, CancellationToken)), or null if its creation has none. Deleting the upload releases it. |
| Length | Gets the length of the file in bytes. |
| Metadata | Gets the service's metadata of the upload, such as the file's name and the endpoint the upload belongs to, as text in a format of the service's own. |
| UserId | Gets the ID of the user the upload belongs to (UserId). |
Methods
| Name | Description |
|---|---|
| GetChunkLength(int) | Gets the length of a chunk in bytes: ChunkSize, or the rest of the file for the last chunk. |
| GetChunkOffset(int) | Gets the offset of a chunk in the file. |