JavaScript/jQuery FileUploader - Overview

The FileUploader UI component enables an end user to upload files to the server. An end user can select files in the file explorer or drag and drop files on the page's FileUploader area.

View Demo

The following code adds the FileUploader to your page. Use the accept property to restrict the file types that can be uploaded to the server. This property is like the underlying <input> element's "accept" attribute and accepts the same values described here.

index.html
index.js
  • <div id="fileUploaderContainer"></div>
  • $(function() {
  • $("#fileUploaderContainer").dxFileUploader({
  • // ...
  • accept: "image/*"
  • });
  • });

A user can upload only one file at a time. Set the multiple property to true to allow users to upload several files at once.

index.js
  • $(function() {
  • $("#fileUploaderContainer").dxFileUploader({
  • multiple: true
  • });
  • });

If you need to access the selected files at runtime, get the value of the value property. The following command returns an array, whose members are each an instance implementing the File interface.

index.js
  • const files = $("#fileUploaderContainer").dxFileUploader("option", "value");

The FileUploader can operate in two different modes, each demanding a different client- and server-side configuration. See the Client-Side Settings article for more details.

See Also