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.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.