I have a file upload button, and I want to get the path of selected file.
Here's my code:
var pniotApp = angular.module('pniotApp', []);
pniotApp.controller('pniotCtrl', function ($scope, $http, $location) {
var temp = [];
Array.prototype.push.apply(temp, element.files);
for (i = 0; i < temp.length;i++)
$scope.fileBuffer.push(temp[i])
}
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body dir="rtl" ng-app="pniotApp" ng-controller="pniotCtrl">
<input id="uploadFile" type="file" class="filestyle" data-classButton="btn btn-primary" multiple data-input="false" data-classIcon="icon-plus" onchange="angular.element(this).scope().fileSelected(this)" data-buttonText="uplaod...">
</body>
How can I get the relative path of the files?
I tried to do this
document.getElementById("uploadFile").value
But I get just the path of the first file.
What can I do?