Method AddDirectoryUploadStore
AddDirectoryUploadStore(IServiceCollection, Action<DirectoryUploadStoreOptions>?)
Registers the directory store as the IUploadStore of chunked uploads (see AddChunkedUploads<TSessionToken>(IServiceCollection, Action<ChunkedUploadOptions>?)), which keeps uploads in a directory on a local disk or a share, as the uploads guide describes.
Declaration
public static IServiceCollection AddDirectoryUploadStore(this IServiceCollection services, Action<DirectoryUploadStoreOptions>? configure = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The service collection to add the services to. |
| Action<DirectoryUploadStoreOptions> | configure | An optional action to configure options, which are validated when the application starts. Directory and SharingMode must be set, here or through configuration. |
Returns
| Type | Description |
|---|---|
| IServiceCollection |
Remarks
The store is a singleton created from the DirectoryUploadStoreOptions of the options system.
The application fails to start if the options are not valid, such as when a required option is not set (the OptionsValidationException lists every problem), or, with ProcessLocal, if another process holds the directory's lock (see SharingMode).
An IUploadStore that is already registered is kept, so calling this again only adds configure.