All docs
V19.1
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
The page you are viewing does not exist in version 19.2.
19.1
18.2
The page you are viewing does not exist in version 18.2.
18.1
The page you are viewing does not exist in version 18.1.
17.2
The page you are viewing does not exist in version 17.2.
A newer version of this page is available. Switch to the current version.

jQuery FileManager - Web API

The Web API file provider works with a file system located on the server.

import WebApiFileProvider from "devextreme/ui/file_manager/file_provider/webapi"
Type:

Object

Set the endpointUrl option to specify the endpoint used to access and modify the file system.

The server should return data objects of the following structure:

{
    name: "MyFile.jpg",
    size: 1024,
    dateModified: "2019/05/08",
    thumbnail: "/thumbnails/images/jpeg.ico",
    isDirectory: true,
    hasSubDirectories: true
}

Fields in this structure have conventional names that you can change via [fieldName]Expr options: nameExpr, sizeExpr, dateModifiedExpr, and so on.

The following code shows how to bind the FileManager to the Web API file provider:

jQuery
index.js
$(function() {
    $("fileManagerContainer").dxFileManager({
        fileProvider: new DevExpress.FileProviders.WebApi({
            endpointUrl: "https://mydomain.com/api/files",
            thumbnailExpr: "icon",
            // ...
        })
    });
});

On the server-side, you need to process file management requests. DevExtreme provides helpers for ASP.NET MVC and ASP.NET Core that do this. To view the server-side code, navigate to the FileManagerApiController.cs tab in the following demo:

View Demo

Configuration

This section describes options that configure the Web API file provider.

Name Description
dateModifiedExpr

Specifies which data field provides timestamps that indicate when a file was last modified.

endpointUrl

Specifies the URL of an endpoint used to access and modify a file system located on the server.

hasSubDirectoriesExpr

Specifies which data field provides information about whether a directory has subdirectories.

isDirectoryExpr

Specifies which data field provides information about whether a file system item is a directory.

nameExpr

Specifies which data field provides file and directory names.

sizeExpr

Specifies which data field provides file sizes.

thumbnailExpr

Specifies which data field provides icons to be used as thumbnails.