gr.File upload directory files and sort them

hello there,
I never developed in gradio and I was wandering if there is a way to sort the files that you upload using gradio.File
in the script I am using it seems like they don’t get sorted alphabetically when showing up in the interface.
If I try to treat the variable I assigned to gr.File it complains is not iterable
Thanks in advance