NUI issue with input files

Hello,

I found an issue with the html input file in FiveM’s NUI.
Here is how to reproduce the issue:

  • Type focus in F8
  • Click on the input to open the file browser and select any file
  • Click again on the input to change the file. It won’t open the file browser again, even if you reset the value of the inpuit.

The expected behavior is to open the file browser again, you can try in the browser it works perfectly.

Repro resource:
nui_bug_repro.zip (707 Bytes)

3 Likes

File selection is not intended to be supported as it wouldn’t work in fullscreen anyway.

What is your use case here?

The use case is giving the user the possibility to upload an avatar/banner for its crew profile, or its profile on a social network app.

It actually works on the first try, but then you can’t open the file browser again.

… without any adverse effects in, say, exclusive/legacy full screen?

No issue, it works fine on the first try in fullscreen too (it unfocuses the game to open the file browser)

Do you know the reason yet? i got the same issue.

He is using it on his server. how did you do it ?

It would be great if this could be looked at.

Especially now, when Imgur and Discord are being blocked, and this could be used to allow user uploads from in-game to some server of our own.

Thread bump
I made my image upload api and everything, was planning to just do a input but that doesn’t seem to work, will have to resort to hosting a page so that players can upload images and use the links, would be easier to just have some kind of file picker that would work in full screen and the rest would be automatically done.