diff --git a/templates/webclient/files.html b/templates/webclient/files.html index 94dd3992..8c3f969f 100644 --- a/templates/webclient/files.html +++ b/templates/webclient/files.html @@ -1069,10 +1069,23 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). let currentDir = '{{.CurrentDir}}'; let ts = new Date().getTime().toString(); let files = JSON.stringify(filesArray); - $(`
- - -
`).appendTo('body').submit().remove(); + const form = document.createElement('form'); + form.method = 'post'; + form.action = `${downloadURL}?path=${currentDir}&_=${ts}`; + form.target = '_blank'; + form.setAttribute('rel', 'noopener noreferrer'); + const tokenInput = document.createElement('input'); + tokenInput.type = 'hidden'; + tokenInput.name = '_form_token'; + tokenInput.value = token; + const filesArea = document.createElement('textarea'); + filesArea.name = 'files'; + filesArea.hidden = true; + filesArea.value = files; + form.append(tokenInput, filesArea); + document.body.appendChild(form); + form.submit(); + form.remove(); }); }