diff --git a/thunorweb/webpack/thunorweb/js/dataset.js b/thunorweb/webpack/thunorweb/js/dataset.js index 803c310b..bf67dde1 100644 --- a/thunorweb/webpack/thunorweb/js/dataset.js +++ b/thunorweb/webpack/thunorweb/js/dataset.js @@ -69,7 +69,7 @@ const activate = function(showLicense) { fetch($this.attr("href")) .then(resp => { - let filename = $this.attr("href").replace(/\/$/, ''); + let filename = resp.url.split('#')[0].split('?')[0].split('/').pop(); filename = filename.substring(filename.lastIndexOf('/') + 1); let disposition = resp.headers.get('content-disposition'); if (disposition && disposition.indexOf('attachment') !== -1) {