Set a default file path for the file_uploader before it opens, so that the file is selected by the st.file_uploader function caller.
Steps to reproduce
Now a days with NPL as the user interface, we donât like to many popping-up widgets to interact with the user.
For example: in an input file field, user just types âPlease processing the file_xyz.txt and give me the resulted file back!â. So the app should work out the file_xyz.txt from the sentence and load it to the streamlit app on the server to process it.
I donât see how a file on the clientâs machine can be uploaded without using the st.file_uploader widget. Even using the widget, there is no way I can pre-select the file path already being worked out from the userâs input.
It would great if the st.file_uploader could be updated to handle such cases, ideally it should be called silently, i.e. no need to popping up.
Thanks for sharing this question. This isnât supported out of the box â there isnât a way to provide st.file_uploader with a file path without allowing the user to select the file.
The problem you would run into even if this were supported is that users donât necessarily know the path to their file off the top of their head. I think youâd end up with users having to search for the file and figure out the path, and at that point, it would be faster/less of a headache for them to select the file. Just my take though.
Feel free to also share this as an enhancement request if youâd like our product team to consider it
The point here is for natural language processing, file paths are often already in the text and the application should process those files silently. Popping up a lot of widgets or clicking a number of buttons for user interactions are too âold fashionâ way of thinking
Hope you your development team could consider such enhancement requests.