I am attempting to download several PDF files when clicking on a button. My current code is working fine in Chrome, but I cannot get it to work in Firefox.
angular.forEach(downloads, function(download) {
$http.get(download.url, {responseType: 'arraybuffer'}).then(function(response) {
var blob = new Blob([response.data], {type: "application/pdf"});
var downloadLink = angular.element('<a></a>');
downloadLink.attr('href',window.URL.createObjectURL(blob));
downloadLink.attr('download', download.name);
downloadLink[0].click();
});
});
They are in the Network tab, however they are never being sent to download.
Are there any workarounds to make this work in Firefox?