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
Export: default
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

    HTML
    <div id="fileUploader"></div>
    JavaScript
    $(function () {
        $("#fileUploader").dxFileUploader({
            accept: 'image/*'
        });
    });
  • AngularJS

    HTML
    <div dx-file-uploader="{
        accept: 'image/*'
    }"></div>
  • Knockout

    HTML
    <div data-bind="dxFileUploader: {
        accept: 'image/*'
    }"></div>
  • ASP.NET MVC Wrappers

    @(Html.DevExtreme().FileUploader()
        .ID("fileUploader")
        .Accept("image/*")
    )

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 topics in the Installation section.

View Demo Watch Video

See Also
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.