Seeking assistance with uploading multiple files using AngularJS... Any advice?
I currently have code that only allows for the upload of a single file. How can I modify it to support multiple file uploads?
Below is my HTML code snippet:
<uib-tab index="5" heading="{{'uploadFile' | translate}}" select="tab.tabName = 'uploadFile'">
<div class="form-group">
<div class="row">
<div class="col-md-12">
<span class="dicom_uploader_title">{{'fileToUpload' | translate}}</span>
<input type="file" class="dicom_uploader_input" file-model="myFile" accept="*" multiple />
<button ng-click="uploadFileNotDicom();" class="btn btn-default">{{'uploadFile' | translate}}</button>
</div>
</div>
</div>
<div>
<h4>{{'otherFilesForPatient' | translate}}</h4>
<button ng-repeat="otherFile in otherFiles" class="btn btn-flat margin-item" ng-click="getDicomFile(otherFile.id,$index)" >{{otherFile.file_name}}.{{otherFile.extention}}</button>
</div>
</uib-tab>
Here is a snippet of my AngularJS code:
$scope.uploadFileNotDicom = function(){
var file = $scope.myFile;
UploadFileService.upload_file(file,null,$scope.patientID).then(function(response){
// Code for displaying success modal
},function(err){
// Code for displaying error modal
})
};
Snippet from the UploadFileService service :
// Code for UploadFileService utilizing Angular
And here is an excerpt from my Yii2 PHP code snippet:
public function actionCreateFiles()
{
// Code for handling file uploads in Yii2
}
Thank you!