Back to Devexpress

IFileContentProvider Interface

aspnetcore-devextreme-dot-aspnet-dot-mvc-dot-filemanagement-a2a29e53.md

latest1.7 KB
Original Source

IFileContentProvider Interface

Provides APIs to get file content.

Namespace : DevExtreme.AspNet.Mvc.FileManagement

Assembly : DevExtreme.AspNet.Core.dll

Declaration

csharp
public interface IFileContentProvider

Remarks

Assign a custom class that implements the IFileContentProvider interface to the FileSystemProvider property to enable a custom file system provider to get file content.

Controller:

cs
public object FileSystem(FileSystemCommand command, string arguments) {
    var config = new FileSystemConfiguration {
        FileSystemProvider = MyFileSystemProvider,
        //...
    }
}

Provider:

cs
public class MyFileSystemProvider : IFileContentProvider {
    //...
    public Stream GetFileContent(FileSystemLoadFileContentOptions options) {
        string tempFileName = string.Format("{0}{1}.tmp", "prefix", Guid.NewGuid().ToString("N"));
        string tempFilePath = Path.Combine("~/temp/", tempFileName);
        //...
    }
}

Concepts

Online Demo

See Also

IFileContentProvider Members

DevExtreme.AspNet.Mvc.FileManagement Namespace