Grid FS is a specification to store files in a Mongo DB database. Redakt offers Grid FS integration through an optional NuGet package. This feature can only be used in combination with the Mongo DB data store module and uses the same connection as the configured Mongo DB instance.
Installation
The GridFS file store is part of the Mongo DB provider package. Install the package with the NuGet package manager or the Package Manager Console.
PM> Install-Package Redakt.Providers.MongoDb
Service registration
Register Grid FS module services in the ConfigureServices()
method of your project's Startup.cs
file by adding an AddGridFsFileStore()
call to the Redakt builder instance. The order in which services are added to the Redakt builder is not important.
public void ConfigureServices(IServiceCollection services)
{
// ... framework and other services here
var builder = services.AddRedakt();
builder.AddMongoDbDataStore(); // Can only be used in combination with Mongo DB database module.
builder.AddGridFsFileStore();
// ... other Redakt services
}
Configuration settings
The Grid FS file storage module uses the same data connection as the Mongo DB database module and does not require any additional configuration.