React FileManager - Custom

A custom provider allows you to implement custom APIs to access and use file systems.

import CustomFileProvider from "devextreme-react/custom"
Type: CustomTypes.default

Use the custom provider's methods to handle file operations (add, delete, rename, and so on).

The following code shows how to create a custom provider and bind the FileManager widget to it:

index.js
  • $(function () {
  • $("#file-manager").dxFileManager({
  • fileProvider: new DevExpress.fileProviders.Custom({
  • getItems: function(pathInfo) {
  • // Your code goes here
  • },
  • renameItem: function(item, name) {
  • // Your code goes here
  • },
  • createDirectory: function(parentDir, name) {
  • // Your code goes here
  • },
  • deleteItem: function(item) {
  • // Your code goes here
  • },
  • moveItem: function(item, destinationDir) {
  • // Your code goes here
  • },
  • copyItem: function(item, destinationDir) {
  • // Your code goes here
  • },
  • uploadFileChunk: function(fileData, chunksInfo, destinationDir) {
  • // Your code goes here
  • },
  • abortFileUpload: function(fileData, chunksInfo, destinationDir) {
  • // Your code goes here
  • },
  • uploadChunkSize: 1000
  • })
  • });
  • });

Props

This section describes options that configure a custom file provider.

Name Description
abortFileUpload

A function that cancels the file upload.

copyItem

A function that copies files or folders.

createDirectory

A function that creates a folder.

dateModifiedExpr

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

deleteItem

A function that deletes a file or folder.

downloadItems

A function that downloads a file or folder.

getItems

A function that gets file system items.

getItemsContent

A function that get items content.

hasSubDirectoriesExpr

A function or the name of a data source field that provides information on whether a file or folder contains sub directories.

isDirectoryExpr

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

keyExpr

Specifies the data field that provides keys.

moveItem

A function that moves files and folders.

nameExpr

Specifies which data field provides file and directory names.

renameItem

A function that renames files and folders.

sizeExpr

Specifies which data field provides file sizes.

thumbnailExpr

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

uploadChunkSize

Specifies a chunk size in bytes.

uploadFileChunk

A function that uploads a file in chunks.

Methods

This section describes members used to manage file system items.

Name Description
getItemContent()

Gets the specified items' content.