ng-file-upload
ng-file-upload copied to clipboard
Dropping file in Chrome sets empty type to file object. (works well in Firefox)
When user drops file in ng-file-drop area, it doesn't set type to file object. which is important property to identify type of file going to be uploaded.
what version of the plugin and what file type?
I was analysing the issue and got to know that the culprit code is in function "extractFiles". where we do check for "evt.dataTransfer.items". Chrome has this property with type being empty. Firefox doesn't have at all so it goes to else case where we create file object from "evt.dataTransfer.files".
I am not sure on these checks. please put in some thoughts.
it's 1.6.5 and i tried with CSV, even you can check here as well http://angular-file-upload.appspot.com/
I just checked this issue is only happening with file type csv.
This issue was fixed before #273 but since version 1.6.5 after fixing an issue with dropping multiple files including directories the issue is reintroduced https://github.com/danialfarid/angular-file-upload/commit/2a6a624e940c1b74634c6b9015a5015c51935392#diff-d41d8cd98f00b204e9800998ecf8427e
For now use the versions prior to 1.6.5 and wait for the next release which will fix this issue.
thanks
Hi, found this in 12.0.4 again?! Any prior changes which could have affected this?
Hi danialfarid my file is showing empty and not upload the image. this is my service function----> var upload = function (file) { var defer = $q.defer(); console.log(file); }; var fd = new FormData();
fd.append('file', file);
console.log(fd);
webApiService.post("/upload", fd, {
transformRequest: angular.identity,
headers: {'Content-Type': undefined}
}).success(function (response) {
defer.resolve(response);
i have get data in file parameter but fd is showing blank and not post the image how to solve it .
Been a year - I'm noticing this issue on types like .xlsx and .psd. Is this fixed?
Hi @danialfarid, I am facing this issue in Chrome 81.0 and Firefox 76.0 with plugin version 12.2.13. On Uploading .xlsx file it sends the content-type as application/octet-stream.