File System Storage Provider is used to store BLOBs in the local file system as standard files inside a folder.
InstallationRead the BLOB Storing document to understand how to use the BLOB storing system. This document only covers how to configure containers to use the file system.
Use the ABP CLI to add Volo.Abp.BlobStoring.FileSystem NuGet package to your project:
.csproj
file you want to add the Volo.Abp.BlobStoring.FileSystem
package.abp add-package Volo.Abp.BlobStoring.FileSystem
command.If you want to do it manually, install the Volo.Abp.BlobStoring.FileSystem NuGet package to your project and add [DependsOn(typeof(AbpBlobStoringFileSystemModule))]
to the ABP module class inside your project.
Configuration is done in the ConfigureServices
method of your module class, as explained in the BLOB Storing document.
Example: Configure to use the File System storage provider by default
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureDefault(container =>
{
container.UseFileSystem(fileSystem =>
{
fileSystem.BasePath = "C:\\my-files";
});
});
});
UseFileSystem
extension method is used to set the File System Provider for a container and configure the file system options.
OptionsSee the BLOB Storing document to learn how to configure this provider for a specific container.
true
): Indicates whether to create a folder with the container name inside the base folder. If you store multiple containers in the same BaseFolder
, leave this as true
. Otherwise, you can set it to false
if you don't like an unnecessarily deeper folder hierarchy.File System Provider organizes BLOB files inside folders and implements some conventions. The full path of a BLOB file is determined by the following rules by default:
BasePath
configured as shown above.host
folder if current tenant is null
(or multi-tenancy is disabled for the container - see the BLOB Storing document to learn how to disable multi-tenancy for a container).tenants/<tenant-id>
folder if current tenant is not null
.AppendContainerNameToBasePath
is true
. If container name contains /
, this will result with nested folders./
it creates folders. If the BLOB name contains .
it will have a file extension.FileSystemBlobProvider
is the main service that implements the File System storage. You can inherit from this class and override methods to customize it.
The IBlobFilePathCalculator
service is used to calculate the file paths. Default implementation is the DefaultBlobFilePathCalculator
. You can replace/override it if you want to customize the file path calculation.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4