Your search did not match any results.
FileUploader

File Uploading

Documentation
In this demo, the FileUploader widget is configured for asynchronous upload. Use the File types drop-down menu to select acceptable file types for the Open file dialog. The Upload mode drop-down menu allows you to specify whether the file is uploaded on a button click or instantly after the file has been selected. In addition, you can specify whether the widget allows multiple file selection.

To select files, click the Select file button or drop the files directly on the widget. If the upload mode is "useButtons", you must click the Upload button or a corresponding button for each file to initiate upload.

IMPORTANT: This demo does not actually upload files. To upload files, assign the URL of a page providing server scenarios for saving uploaded files to the uploadUrl configuration option of the widget.
Copy to CodePen
Apply
Reset
var DemoApp = angular.module('DemoApp', ['dx']); DemoApp.controller('DemoController', function DemoController($scope) { $scope.multiple = false; $scope.accept = "*"; $scope.value = []; $scope.uploadMode = "instantly"; $scope.options = { uploadUrl: "https://js.devexpress.com/Content/Services/upload.aspx", bindingOptions: { multiple: "multiple", accept: "accept", value: "value", uploadMode: "uploadMode" } }; $scope.acceptOptions = { dataSource: [ {name: "All types", value: "*"}, {name: "Images", value: "image/*"}, {name: "Videos", value: "video/*"} ], valueExpr: "value", displayExpr: "name", bindingOptions: { value: "accept" } }; $scope.uploadOptions = { items: ["instantly", "useButtons"], bindingOptions: { value: "uploadMode" } }; });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" > <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" /> <script src="js/jquery-3.1.0.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.light.css" /> <link rel="dx-theme" data-theme="android5.light" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.android5.light.css" /> <link rel="dx-theme" data-theme="ios7.default" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.ios7.default.css" /> <link rel="dx-theme" data-theme="win10.black" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.win10.black.css" /> <link rel="dx-theme" data-theme="win10.white" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.win10.white.css" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script> <script>window.angular || document.write(decodeURIComponent('%3Cscript src="js/angular.min.js"%3E%3C\/script%3E'))</script> <script src="https://cdn3.devexpress.com/jslib/17.1.7/js/dx.all.js"></script> <link rel="stylesheet" type ="text/css" href ="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container" ng-app="DemoApp" ng-controller="DemoController"> <div id="fileuploader"> <div class="widget-container"> <div dx-file-uploader="options"> </div> <div class="content"> <div ng-if="value.length > 0"> <h4>Selected Files</h4> </div> <div ng-repeat="val in value"> <div class="selected-item"> Name: <span>{{val.name}}</span><br /> Size: <span>{{val.size}}</span>bytes<br /> Type: <span>{{val.type}}</span><br /> Last Modified Date: <span>{{val.lastModifiedDate}}</span> </div> </div> </div> </div> <div class="options"> <div class="caption">Options</div> <div class="option"> <span>File types</span> <div dx-select-box="acceptOptions"></div> </div> <div class="option"> <span>Upload mode</span> <div dx-select-box="uploadOptions"></div> </div> <div class="option"> <div dx-check-box="{ text: 'Allow multiple files selection', bindingOptions: { value: 'multiple' } }"></div> </div> </div> </div> </div> </body> </html>
.widget-container { margin-right: 320px; } .content h4 { margin-bottom: 10px; font-weight: 500; font-size: 18px; } .content { margin-top: 50px; margin-left: 10px; } .selected-item { margin-bottom: 20px; } #selected-files { display: none; } .options { padding: 20px; background-color: #f5f5f5; position: absolute; right: 0; top: 0; bottom: 0; width: 260px; } .caption { font-size: 18px; font-weight: 500; } .option { margin-top: 10px; }