I am using this plugin to make it possible to download files or at least I try to but it won't work.
I put the mentioned cookie in my index.php at top position like this:
header('Set-Cookie: fileDownload=true; path=/');
The cookie is set, I can see that in the site information. My js code on the current site looks like this:
$('.js--download').on('click', function(){
var target = $(this).attr('href');
$.fileDownload(target)
.done(function () { alert('File download a success!'); })
.fail(function () { alert('File download failed!'); });
return false; //this is critical to stop the click event which will trigger a normal file download!
});
The problem is that the .done function is fired but the download didn't start. I also wonder why I can see now request send by the network in my browser inspect tool. When it's really an ajax call I should see it there.
So, someone with an idea?