Reputation: 1131
Since two days I have an error when I upload files in AJAX ft. angularJS using this script https://github.com/danialfarid/angular-file-upload . But just after I select the file I want to upload, I have a TypeError:
TypeError: Failed to execute 'append' on 'FormData': No function was found that matched the signature provided. at TypeError (native)
at upload (http://localhost:8888/angular-file-upload.min.js:2:1609)
at h.$scope.onFileSelect (http://localhost/UploadCtrl.js:31:29)
at http://localhost/angular.min.js:166:92
at http://localhost/angular-file-upload.min.js:2:1991
at http://localhost/angular.min.js:115:185
at e (http://localhost:8888/angular.min.js:33:421)
at http://localhost:8888/angular.min.js:37:77
If I use an other browser like Firefox,Safari,Opera, even IE, all work fine..
Thank you for your help.
Upvotes: 1
Views: 554
Reputation: 11
Angular expects the file that is uploaded to implement the Blob interface.
https://developer.mozilla.org/en-US/docs/Web/API/Blob
I had this error in a Jasmine test and solved it by creating a new Blob like this.
var file = new Blob();
Upvotes: 1