The Dangl.AspNetCore.FileHandling package offers reusable tasks for web project that deal with file I/O, for example disk or Azure Blob storage access.
FileHandlerDefaults defaults limits to adhere to when using file and container names. It is enforced to ensure a compatibility with Azure blob storage.
IFileHandler interface defines how to store and retrieve files.
DiskFileHandler works by storing files on a disk drive.
For test purposes, the
InMemoryFileHandler offers additional features like
ClearFiles() to reset all saved files and a property
SavedFiles to access all saved files.
This implementation works against Azure Blob Storage. Additionally, it has a
Task<RepositoryResult> EnsureContainerCreated(string container) for initialization purposes.
Azure Blob containers must be created before they can be accessed.
StringExtensions class has a static extension method
string WithMaxLength(this string value, int maxLength).
This library offers two extensions for dependency injection,
AddInMemoryFileManager() (for testing) and