Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

HomeDev GuideRecipesAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Configure a custom BLOB provider

Add a BlobProviders in appsettings.json under episerver/cms element to define a custom provider:

{
  "EPiServer": {
    "Cms": {
      "BlobProviders": {
        "DefaultProvider": "Custom",
        "Providers": {
          "Custom": "CustomProvider, Customassembly"
          "Another": "Another_CustomProvider, Customassembly"
        }
      }
    }
  }
}

Another option is to add the BLOB provider programmatically during the site configuration phase. This can be done by using IServiceCollection or by configuring the BlobOptions class directly.

public void ConfigureServices(IServiceCollection services) {
  // This provider will be added as the default
  services.AddFileBlobProvider("myFileBlobProvider", @ "c:\path\to\file\blobs");
  services.AddBlobProvider<MyCustomBlobProvider>("myCustomBlobProvider", defaultProvider: false);
  services.Configure<MyCustomBlobProvider>(o => {
    o.AddProvider<MyCustomBlobProvider>("anotherCustomBlobProvider");
    o.DefaultProvider = "anotherCustomBlobProvider";
  });
}