fix #6475: ui: upload: only show the file name of the selected file
For privacy reasons, browsers do not expose the real path of a selected file and prefix its name with 'C:\fakepath\' instead, on every platform. The file field of the upload window shows this value as is, which confuses users on Linux or macOS clients. Show the name of the selected file object instead. Only the displayed value changes, the upload itself uses the file object and is not affected. Signed-off-by: Michal Fox <me@dualfroz.com> Reviewed-by: Max R. Carrara <m.carrara@proxmox.com> Tested-by: Max R. Carrara <m.carrara@proxmox.com> Link: https://lore.proxmox.com/20260926084935.7-1-me@dualfroz.com
This commit is contained in:
1 parent
2f1b95ec37
commit
f353e94052
1 file changed
+2
@@ -167,6 +167,8 @@ Ext.define('PVE.window.UploadToStorage', {
|
||||
(fileInput.files[0] && Proxmox.Utils.format_size(fileInput.files[0].size)) || '-',
|
||||
);
|
||||
vm.set('mimetype', (fileInput.files[0] && fileInput.files[0].type) || '-');
|
||||
// browsers hide the real path behind 'C:\fakepath\', so only show the file name
|
||||
input.setRawValue(fileInput.files[0]?.name ?? '');
|
||||
},
|
||||
|
||||
hashChange: function (field, value) {
|
||||
|
||||
Reference in new issue
Block a user