danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.6k forks source link

Upload.upload hitting server multiple times in longer server response time. #2008

Open chris3382 opened 6 years ago

chris3382 commented 6 years ago

Hi Danial,

Thank you very much for this miracle plugin its working like a charm. I ran into a issue and struggling to fix it since a week.

I am uploading multiple files at a click of a button to the server. Also along with this passing data in form of a Object. The files which I upload include videos, pdfs, docs, xls etc. At times when the server takes longer time to respond with a success message. The Upload.upload hits the server api multiple times depending on the sever response time. This behaviour is not consistent only happens when the server takes long time to respond. Is there a fix for this?

Upload.upload({ url: server + '/users/' + $rootScope.currentUser.id + '/upload', method: 'POST', data: courseOffering }).then( function (response) { });

The courseOffering object contains multiple files with other data.