Your search did not match any results.
File Uploader

File Uploading

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
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: "", 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", width: 200, bindingOptions: { value: "accept" } }; $scope.uploadOptions = { items: ["instantly", "useButtons"], width: 200, bindingOptions: { value: "uploadMode" } }; });
<!DOCTYPE html> <html xmlns="" > <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="" /> <link rel="stylesheet" type="text/css" href="" /> <link rel="dx-theme" data-theme="generic.light" href="" /> <link rel="dx-theme" data-theme="android5.light" href="" /> <link rel="dx-theme" data-theme="ios7.default" href="" /> <link rel="dx-theme" data-theme="" href="" /> <link rel="dx-theme" data-theme="win10.white" href="" /> <script src=""></script> <script>window.angular || document.write(decodeURIComponent('%3Cscript src="js/angular.min.js"%3E%3C\/script%3E'))</script> <script src=""></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 dx-file-uploader="options"> </div> <div class="content"> <h4>Options</h4> <div> <div>File types:</div> <div class="option" dx-select-box="acceptOptions"></div> </div> <div> <div>Upload mode:</div> <div dx-select-box="uploadOptions"></div> </div> <div dx-check-box="{ text: 'Allow multiple files selection', bindingOptions: { value: 'multiple' } }"></div> </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>{{}}</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> </body> </html>
.content h4 { margin-bottom: 10px; font-weight: 500; font-size: 18px; } .option{ margin-bottom: 10px; } .content { margin-top: 50px; margin-left: 10px; } .selected-item { margin-bottom: 20px; }