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

Getting Back Response in Failure Callback

Open jcope2013 opened this issue 11 years ago • 4 comments

This below code shown in the blog post doesn't work for some reason related to promise callbacks, neither get triggered properly after a successful file download

$.fileDownload('some/file/url')
    .done(function () { alert('File download a success!'); })
    .fail(function () { alert('File download failed!'); });

also successCallback & failCallback both get triggered on a successful file download and neither have the response available, is there any way to do a more traditional jquery ajax call, something like this

$.fileDownload(url, options).then(function(data) {
                console.log("File download a success!" + data);
            }, function(response) {
                 console.log("File download failed!" + response);
            });

jcope2013 avatar Nov 19 '14 00:11 jcope2013

Hmm it could be related to the last PR I did. I can take a look here for now try using the previous file version

johnculviner avatar Nov 19 '14 05:11 johnculviner

@johnculviner switching back to v1.4.2 didn't seem to work with either of those snippets either

jcope2013 avatar Nov 19 '14 05:11 jcope2013

@johnculviner I am having the same issue as @jcope2013. Was this ever resolved?

katiepekarek avatar Jul 15 '16 18:07 katiepekarek

Make sure you do it just like the example and the responses are similar in the success and failure cases. Otherwise not sure...

johnculviner avatar Jul 17 '16 20:07 johnculviner