The "File Upload" inverts the files order

When i select files to upload somewhere with “File Upload”, such as 1.jpg , 2.jpg , and 3.jpg , they will be uploaded in the inverse order. Is there a way to fix it?

What browser are you using? I can reproduce that with the Firefox flatpak, but not with Chrome.

Upon further testing, it doesn’t happen in the Firefox in the base image unless I make it use the FileChooser portal in about:config. Since it doesn’t happen in the Chrome flatpak which also uses the portal, this is probably a Firefox bug.

Firefox (Flatpak).

From dbus-monitor, it appears that the files are being provided by the portal in the correct order, and Firefox is just using GtkFileChooserNative, so that would make it a GTK3 bug.

Looking in GTK3’s source, I immediately noticed a g_slist_prepend() loop without a g_slist_reverse() at the end. Coincidentally, this has recently been fixed in GTK4:

That would need to be backported to GTK3.

2 Likes