FileUploader

The FileUploader widget enables an end user to upload files to the server. An end user can select files in the file exlorer or drag and drop files to the FileUploader area on the page.

Included in: dx.mobile.js, dx.web.js, dx.viz-web.js, dx.all.js
FileUploader interactive configuration
Copy Code
Copy to Codepen
$("#fileuploader").dxFileUploader({
});

The FileUploader widget is based on an input element with the type attribute set to "file". Values of widget options are passed to appropriate attributes of the underlying input element.

You can create the widget using one of the following approaches.

  • jQuery
    Use the dxFileUploader jQuery plug-in.

    HTML
    <div id="fileUploader"></div>
    JavaScript
    $("#fileUploader").dxFileUploader({
        buttonText: 'Select file',
        labelText: 'Drop file here',
        multiple: true,
        accept: 'image/*'
    });
  • Knockout
    Add a div element and apply the dxFileUploader binding to this element.

    HTML
    <div data-bind="dxFileUploader: {
        buttonText: 'Select file',
        labelText: 'Drop file here',
        multiple: true,
        accept: 'image/*'
    }"></div>
  • AngularJS
    Add a div element and apply the dx-file-uploader directive to this element.

    HTML
    <div dx-file-uploader="{
        buttonText: 'Select file',
        labelText: 'Drop file here',
        multiple: true,
        accept: 'image/*'
    }"></div>

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the Installation article.

You can find detailed information on the principles of working with the widget in the dxFileUploader section of the Editor Widgets article.

View Demo

Watch Video

Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the FileUploader widget.

Methods

This section describes the members used to manipulate the widget.

Events

This section describes events fired by this widget.