Interface IUploaderProvider
Defines the storage operations used by CoreUpload to save, read, move, and maintain uploaded files.
Providers abstract where uploaded file contents and metadata live.
Assembly: CoreUpload.dll
Syntax
public interface IUploaderProvider
Methods
AppendAsync(Guid, string, Stream, CancellationToken)
Appends additional content to an existing uploaded file.
Declaration
Task AppendAsync(Guid guid, string fileName, Stream stream, CancellationToken ct = default)
Parameters
Returns
AssembleChunksAsync(string, string, int, CancellationToken)
Assembles all previously stored chunks for an upload session and returns the resulting file GUID.
Declaration
Task<Guid> AssembleChunksAsync(string uploadId, string fileName, int totalChunks, CancellationToken ct = default)
Parameters
Returns
CopyToAsync(Guid, string, CancellationToken)
Copies a stored upload to a new destination path while keeping the original file.
Declaration
Task CopyToAsync(Guid guid, string destinationPath, CancellationToken ct = default)
Parameters
Returns
DeleteAsync(Guid, CancellationToken)
Deletes a stored upload and its metadata.
Declaration
Task DeleteAsync(Guid guid, CancellationToken ct = default)
Parameters
Returns
GetCompletedChunksAsync(string, CancellationToken)
Gets the number of chunks already stored for a chunked upload session.
Declaration
Task<int> GetCompletedChunksAsync(string uploadId, CancellationToken ct = default)
Parameters
Returns
GetFilePathAsync(Guid, CancellationToken)
Gets the local file-system path for a stored upload when the provider supports direct file access.
Declaration
Task<string?> GetFilePathAsync(Guid guid, CancellationToken ct = default)
Parameters
Returns
GetInfoAsync(Guid, CancellationToken)
Gets metadata for a stored upload.
Returns null when the file does not exist.
Declaration
Task<UploadedFileInfo?> GetInfoAsync(Guid guid, CancellationToken ct = default)
Parameters
Returns
GetSavedChunksAsync(string, CancellationToken)
Gets the chunk indexes (and their stored byte sizes) already saved for a
chunked upload session, so a resuming client can reconcile its local
"completed" map with what the server actually holds.
Returns null when the provider cannot enumerate chunks
(the default for custom providers that predate this member).
Declaration
Task<IReadOnlyDictionary<int, long>?> GetSavedChunksAsync(string uploadId, CancellationToken ct = default)
Parameters
Returns
GetUploadedLengthAsync(string, CancellationToken)
Gets the total number of bytes already stored for a chunked upload session.
Declaration
Task<long> GetUploadedLengthAsync(string uploadId, CancellationToken ct = default)
Parameters
Returns
MaintainAsync(CancellationToken)
Performs provider-specific maintenance such as expiring temporary uploads and stale chunk sessions.
Declaration
Task MaintainAsync(CancellationToken ct = default)
Parameters
Returns
MoveToAsync(Guid, string, CancellationToken)
Moves a stored upload to a new destination path.
Declaration
Task MoveToAsync(Guid guid, string destinationPath, CancellationToken ct = default)
Parameters
Returns
OpenReadAsync(Guid, CancellationToken)
Opens a readable stream for a stored upload.
The caller is responsible for disposing the returned stream.
Declaration
Task<Stream> OpenReadAsync(Guid guid, CancellationToken ct = default)
Parameters
Returns
PersistAsync(Guid, CancellationToken)
Marks a stored upload as persisted so routine cleanup does not remove it.
Declaration
Task PersistAsync(Guid guid, CancellationToken ct = default)
Parameters
Returns
SaveAsync(Guid, string, Stream, CancellationToken)
Saves a new uploaded file and its metadata.
Declaration
Task SaveAsync(Guid guid, string fileName, Stream stream, CancellationToken ct = default)
Parameters
Returns
SaveChunkAsync(string, int, Stream, CancellationToken)
Saves a single chunk for an upload session.
Declaration
Task SaveChunkAsync(string uploadId, int chunkIndex, Stream stream, CancellationToken ct = default)
Parameters
Returns