In an Anggular web app I have a form. I want to update a file, so I used lf-ng-md-file-input. This is the easy html:
<lf-ng-md-file-input lf-files='files' multiple> </lf-ng-md-file-input>
In my Controller, I did this:
let formData = new FormData();
angular.forEach(this.$scope.files,function(obj){
formData.append('files[]', obj.lfFile);
});
Debugging it, I see that obj.lfFile exists:
lastModified:1473694273813
lastModifiedDate:Mon Sep 12 2016 17:31:13 GMT+0200 (ora legale Europa occidentale)
name:"test.jpg"
size:39790
type:"image/jpeg"
webkitRelativePath:""
The problem is that it doesn't append the file in my formData. It is still empty after the loop. Why?