I don’t think it is possible due to web securities think I’ve read this somewhere before
My understanding is file selector works server side that’s why you can get file path, fileinput widget is a feature of the web browser and constrained to its rules
I don’t understand. Why is this possible with Tk but not Panel?
It would be nice if FileSelector were a modal file dialog. In most cases, I don’t want to display the FileSelector unless I am selecting a file or directory.
the FileSelector is just meant to access files that are hosted on the server
web browsers cannot get the full path to files on your system, for security reasons as already mentioned
I am pretty sure the tkinter trick just works locally, i.e. when you or your users are using the app by launching it locally with Panel, not just by visiting a URL. It’s fine if that’s the intended usage of your app, but a pretty big limitation if it’s meant to be served over a network.
Ok! Maybe then you could open a feature request on Panel’s Github. I believe that the current FileSelector could be improved to get a widget that’s good enough to select a file:
double clicking on a repository should open it (now it’s done with a button)
there could be a parameter to limit the number of files selected
But you could also open a feature request for a new widget. Before that though you could try to look around if this is something that is actually common and how it’s implemented (maybe with django, flask, etc.)