From 614b3cd48864cb546ea33fa670594e498d01a8c4 Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Thu, 5 May 2022 15:52:50 +0200 Subject: [PATCH] fix #4001: FileBrowser: add a configurable prefix to downloaded files Signed-off-by: Stefan Sterz --- src/window/FileBrowser.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/window/FileBrowser.js b/src/window/FileBrowser.js index 54967c2..9ad2e81 100644 --- a/src/window/FileBrowser.js +++ b/src/window/FileBrowser.js @@ -93,6 +93,9 @@ Ext.define("Proxmox.window.FileBrowser", { // "Download" button when the selection can be downloaded as // .tar files enableTar: false, + + // prefix to prepend to downloaded file names + downloadPrefix: '', }, controller: { @@ -124,12 +127,11 @@ Ext.define("Proxmox.window.FileBrowser", { let data = selection[0].data; - let atag = document.createElement('a'); - - atag.download = data.text; let params = { ...view.extraParams }; params.filepath = data.filepath; - atag.download = data.text; + + let atag = document.createElement('a'); + atag.download = view.downloadPrefix + data.text; if (data.type === 'd') { if (tar) { params.tar = 1;