IFileProvider Interface

Serves as a base interface that defines options to create custom file system providers.

Namespace: DevExtreme.AspNet.Mvc.FileManagement

Assembly: DevExtreme.AspNet.Core.dll


public interface IFileProvider


This examples shows how to use the IFileProvider interface to get and process data from a database in the File Manager in a custom way.

public class DbFileProvider : IFileProvider {
    ArtsDBContext DataContext { get; }
    public DbFileProvider(ArtsDBContext _context) {
        DataContext = _context;
    public void Copy(string sourceKey, string destinationKey) {
        Arts sourceItem = GetDbItemByFileKey(sourceKey);
        Arts targetItem = GetDbItemByFileKey(Path.GetDirectoryName(destinationKey));
        if (targetItem.Id == sourceItem.ParentId)
            throw new SecurityException("You can't copy to the same folder.");
        List<Arts> childItems = DataContext.Arts.Where(p => p.ParentId == targetItem.Id).ToList();
        if (childItems.Select(i => i.Name).Contains(sourceItem.Name))
            throw new SecurityException("The folder contains an item with the same name.");
        CopyFolderInternal(sourceItem, targetItem);
    public void CreateDirectory(string rootKey, string name) {
        // your code

    public IList<IClientFileSystemItem> GetDirectoryContents(string dirKey) {
        // your code
    public void Move(string sourceKey, string destinationKey) {
        // your code

Online Demo: File Manager - Entity Framework ORM

Online Example: File Manager - How to connect to a database using IFIleSystemProvider

See Also