Your search did not match any results.
File Manager

Overview

Documentation

The DevExtreme HTML5 JavaScript FileManager widget allows you to display and manage files and directories for different file systems. The FileManager widget uses file system providers to access file systems. Use the fileSystemProvider option to configure the widget's file system provider. The "File System Types" demo group illustrates how to use the FileManager widget with different file system providers.

The widget's default security settings provide read-only access to files and directories. Use the permissions option to deny or allow a user to copy, create, move, delete, rename, upload, and download files and directories. You can also specify file restrictions: allowed file extensions (allowedFileExtensions), chunk size (chunkSize) and maximum file size (maxFileSize).

Use the widget's itemView option or the view switcher on the toolbar to display file system items as a detailed list or customizable thumbnails.

This demo contains commented out code lines that enable file modification operations. You can uncomment them and configure if necessary.

Copy to CodeSandBox
Apply
Reset
import React from 'react'; import FileManager, { Permissions } from 'devextreme-react/file-manager'; import RemoteFileSystemProvider from 'devextreme/file_management/remote_provider'; import { Popup } from 'devextreme-react/popup'; const remoteProvider = new RemoteFileSystemProvider({ endpointUrl: 'https://js.devexpress.com/Demos/Mvc/api/file-manager-file-system-images' }); class App extends React.Component { constructor(props) { super(props); this.state = { currentPath: 'Widescreen', popupVisible: false, imageItemToDisplay: {} }; this.displayImagePopup = this.displayImagePopup.bind(this); this.hideImagePopup = this.hideImagePopup.bind(this); this.onCurrentDirectoryChanged = this.onCurrentDirectoryChanged.bind(this); } displayImagePopup(e) { this.setState({ popupVisible: true, imageItemToDisplay: { name: e.file.name, url: e.file.dataItem.url } }); } hideImagePopup() { this.setState({ popupVisible: false }); } onCurrentDirectoryChanged(e) { this.setState({ currentPath: e.component.option('currentPath') }); } render() { return ( <div> <FileManager currentPath={this.state.currentPath} fileSystemProvider={remoteProvider} onSelectedFileOpened={this.displayImagePopup} onCurrentDirectoryChanged={this.onCurrentDirectoryChanged}> <Permissions create={true} copy={true} move={true} delete={true} rename={true} upload={true} download={true}> </Permissions> </FileManager> <Popup maxHeight={600} closeOnOutsideClick={true} title={this.state.imageItemToDisplay.name} visible={this.state.popupVisible} onHiding={this.hideImagePopup} className="photo-popup-content"> <img src={this.state.imageItemToDisplay.url} className="photo-popup-image" /> </Popup> </div> ); } } export default App;
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App.js'; ReactDOM.render( <App />, document.getElementById('app') );
<!DOCTYPE html> <html> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/20.1.8/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/20.1.8/css/dx.light.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/20.1.8/css/dx-gantt.min.css" /> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script> <script src="https://unpkg.com/systemjs@0.21.3/dist/system.js"></script> <script type="text/javascript" src="config.js"></script> <script type="text/javascript"> System.import('./index.js'); </script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="app"></div> </div> </body> </html>
.photo-popup-content { text-align: center; } .photo-popup-content .photo-popup-image { height: 100%; max-width: 100%; }
System.config({ transpiler: 'plugin-babel', meta: { }, paths: { 'npm:': 'https://unpkg.com/' }, defaultExtension: 'js', map: { 'react': 'npm:react@16/umd/react.development.js', 'react-dom': 'npm:react-dom@16/umd/react-dom.development.js', 'prop-types': 'npm:prop-types/prop-types.js', 'devextreme': 'npm:devextreme@20.1', 'devextreme-react': 'npm:devextreme-react@20.1', 'jszip': 'npm:jszip@3.1.3/dist/jszip.min.js', 'quill': 'npm:quill@1.3.7/dist/quill.js', 'devexpress-diagram': 'npm:devexpress-diagram@1.0.17', 'devexpress-gantt': 'npm:devexpress-gantt@1.0.10', // SystemJS plugins 'plugin-babel': 'npm:systemjs-plugin-babel@0/plugin-babel.js', 'systemjs-babel-build': 'npm:systemjs-plugin-babel@0/systemjs-babel-browser.js' }, packages: { 'devextreme': { defaultExtension: 'js' }, 'devextreme-react': { main: 'index.js' }, 'devextreme/events/utils': { main: 'index' }, 'devextreme/events': { main: 'index' }, }, babelOptions: { sourceMaps: false, stage0: true, react: true } });