public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH manager] fix #6475: ui: upload: only show the file name of the selected file
@ 2026-09-26  8:49 Michal Fox
  2026-09-28 14:02 ` Max R. Carrara
  2026-09-30 10:27 ` applied: " Dominik Csapak
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Fox @ 2026-09-26  8:49 UTC (permalink / raw)
  To: pve-devel

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>
---
 www/manager6/window/UploadToStorage.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/www/manager6/window/UploadToStorage.js b/www/manager6/window/UploadToStorage.js
index cc53596d..8010e127 100644
--- a/www/manager6/window/UploadToStorage.js
+++ b/www/manager6/window/UploadToStorage.js
@@ -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) {
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH manager] fix #6475: ui: upload: only show the file name of the selected file
  2026-09-26  8:49 [PATCH manager] fix #6475: ui: upload: only show the file name of the selected file Michal Fox
@ 2026-09-28 14:02 ` Max R. Carrara
  2026-09-28 14:07   ` Max R. Carrara
  2026-09-30 10:27 ` applied: " Dominik Csapak
  1 sibling, 1 reply; 4+ messages in thread
From: Max R. Carrara @ 2026-09-28 14:02 UTC (permalink / raw)
  To: Michal Fox, pve-devel

On Sat Sep 26, 2026 at 10:49 AM CEST, Michal Fox wrote:
> 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>
> ---

Gave this a spin on my workstation and can confirm that only the file's
name is displayed. Code also looks fine to me.

LGTM! Thanks a lot for your contribution!

Consider:

Reviewed-by: Max R. Carrara <m.carrara@proxmox.com>
Tested-by: Max R. Carrara <m.carrara@proxmox.com>

>  www/manager6/window/UploadToStorage.js | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/www/manager6/window/UploadToStorage.js b/www/manager6/window/UploadToStorage.js
> index cc53596d..8010e127 100644
> --- a/www/manager6/window/UploadToStorage.js
> +++ b/www/manager6/window/UploadToStorage.js
> @@ -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) {





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH manager] fix #6475: ui: upload: only show the file name of the selected file
  2026-09-28 14:02 ` Max R. Carrara
@ 2026-09-28 14:07   ` Max R. Carrara
  0 siblings, 0 replies; 4+ messages in thread
From: Max R. Carrara @ 2026-09-28 14:07 UTC (permalink / raw)
  To: Max R. Carrara, Michal Fox, pve-devel

On Mon Sep 28, 2026 at 4:02 PM CEST, Max R. Carrara wrote:
> On Sat Sep 26, 2026 at 10:49 AM CEST, Michal Fox wrote:
> > 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>
> > ---
>
> Gave this a spin on my workstation and can confirm that only the file's
> name is displayed. Code also looks fine to me.

Forgot to mention that I checked this on both Firefox and Chromium.
Works in both cases.

>
> LGTM! Thanks a lot for your contribution!
>
> Consider:
>
> Reviewed-by: Max R. Carrara <m.carrara@proxmox.com>
> Tested-by: Max R. Carrara <m.carrara@proxmox.com>
>
> >  www/manager6/window/UploadToStorage.js | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/www/manager6/window/UploadToStorage.js b/www/manager6/window/UploadToStorage.js
> > index cc53596d..8010e127 100644
> > --- a/www/manager6/window/UploadToStorage.js
> > +++ b/www/manager6/window/UploadToStorage.js
> > @@ -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) {





^ permalink raw reply	[flat|nested] 4+ messages in thread

* applied: [PATCH manager] fix #6475: ui: upload: only show the file name of the selected file
  2026-09-26  8:49 [PATCH manager] fix #6475: ui: upload: only show the file name of the selected file Michal Fox
  2026-09-28 14:02 ` Max R. Carrara
@ 2026-09-30 10:27 ` Dominik Csapak
  1 sibling, 0 replies; 4+ messages in thread
From: Dominik Csapak @ 2026-09-30 10:27 UTC (permalink / raw)
  To: pve-devel, Michal Fox

On Sat, 26 Sep 2026 08:49:35 +0000, Michal Fox wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/1] fix #6475: ui: upload: only show the file name of the selected file
      commit: e42092eaee50fe726b0e1267f625425833075d5a




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-30 10:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-26  8:49 [PATCH manager] fix #6475: ui: upload: only show the file name of the selected file Michal Fox
2026-09-28 14:02 ` Max R. Carrara
2026-09-28 14:07   ` Max R. Carrara
2026-09-30 10:27 ` applied: " Dominik Csapak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal