jquery.fileDownload icon indicating copy to clipboard operation
jquery.fileDownload copied to clipboard

Multiple call of $.fileDownload invokes callback only one time

Open mkozhevnikov opened this issue 9 years ago • 4 comments

I call fileDownload by this

$.each(response.names, function (i, name) {
    $.fileDownload('/Report/Download?name=' + name, {
        successCallback: function () {
            console.log(i, name, response.names.length);
        },
        failCallback: function () { alert("FAIL!!!") }
    });
});

But in browser console I see only one log message. Maybe it's arcitecture decision to invoke callback one time?! It would be great to get callback invoked each times! Thanx

mkozhevnikov avatar Aug 06 '15 11:08 mkozhevnikov

With jQuery-like done and fail handlers I've got callback invoked only on first iteration too.

mkozhevnikov avatar Aug 06 '15 11:08 mkozhevnikov

I have the same problem, and is important that i can get the callback

ealfonsov89 avatar Oct 12 '15 14:10 ealfonsov89

this plugin isn't capable of watching for multiple file downloads at the same time because the same cookie is used for each. you will have to try something different if you want this to work reliably

johnculviner avatar Oct 12 '15 14:10 johnculviner

hi, tanks for the info, i try this and work for me: document.cookie = "fileDownload=true; path=/"; $.fileDownload(combined).then(function() { $http.downSrcId = data.code; compressService.delete(); document.cookie = "fileDownload=false; path=/"; });

ealfonsov89 avatar Oct 12 '15 14:10 ealfonsov89