I am currently using ngFileUpload to upload files, but it only allows me to upload one file at a time.
I would like to be able to upload both an Image File and a PDF File together. Is there a way to upload multiple files at once?
Any assistance or guidance on how to achieve this would be greatly appreciated.
(function () {
'use strict';
var app = angular.module('pageApp', ['ngFileUpload']);
app.controller('MyCtrl', ['$scope', 'Upload', '$timeout', function ($scope, Upload, $timeout) {
$scope.uploadPic = function (file) {
file.upload = Upload.upload({
url: 'save_form.php',
data: {
file: file,
username: $scope.username
},
});
file.upload.then(function (response) {
$timeout(function () {
file.result = response.data;
});
}
};
}]);
})();
<form name="myForm">
Profile Picture: <input type="file" ngf-select="" ng-model="picFile" name="file" ngf-accept="'image/*'">
<br>
Resume(.pdf): <input type="file" ngf-select="" ng-model="resumeFile" name="fileResume">
<br>
<button ng-disabled="!myForm.$valid" ng-click="uploadPic(picFile)">Submit</button>
</form>