Method AddChunkedUploads
AddChunkedUploads<TSessionToken>(IServiceCollection, Action<ChunkedUploadOptions>?)
Registers the services of chunked uploads, whose endpoints are mapped with MapChunkedUpload (see
ChunkedUploadEndpointRouteBuilderExtensions), including a hosted service that removes expired uploads. Uploads belong to the
signed-in user of the session token type, and are kept in the directory store unless the app registers an IUploadStore of its own
as a singleton, before or after this call.
Declaration
public static IServiceCollection AddChunkedUploads<TSessionToken>(this IServiceCollection services, Action<ChunkedUploadOptions>? configure = null) where TSessionToken : class, ISessionToken
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The service collection to add the services to. |
| Action<ChunkedUploadOptions> | configure | An optional action to configure options, which are validated when the app starts. |
Returns
| Type | Description |
|---|---|
| IServiceCollection |
Type Parameters
| Name | Description |
|---|---|
| TSessionToken | The session token type of the app's session handling. |
Remarks
The application fails to start if session handling is not registered for TSessionToken, or if
Directory is not set and the app registers no IUploadStore.