When downloading an ISO from a URL without querying for the
metadata, one can set a custom filename. If this filename is trailed by
blank spaces, trying to download will result in the error:
'Parameter verification failed. (400) filename: wrong file extension'

To correctly detect file extensions, adjust the getSubmitValue function
for this specific textfield to trim the filename for blankspaces.

Signed-off-by: Lukas Sichert <[email protected]>
---
 www/manager6/window/DownloadUrlToStorage.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/www/manager6/window/DownloadUrlToStorage.js 
b/www/manager6/window/DownloadUrlToStorage.js
index 4fe4c669..f1c4392c 100644
--- a/www/manager6/window/DownloadUrlToStorage.js
+++ b/www/manager6/window/DownloadUrlToStorage.js
@@ -165,6 +165,9 @@ Ext.define('PVE.window.DownloadUrlToStorage', {
                     allowBlank: false,
                     fieldLabel: gettext('File name'),
                     emptyText: gettext('Please (re-)query URL to get meta 
information'),
+                    getSubmitValue: function () {
+                        return 
this.processRawValue(this.getRawValue())?.trim();
+                    },
                 },
             ],
             column1: [
-- 
2.47.3



Reply via email to