Get path from file_uploader()

I need to be able to retrieve the path and filename based on the user’s selection from the file_uploader. Having this information would allow me to update a json config file for future session automatic file loading.

Thank you for any advise.

greg

1 Like

Hi @555gam, welcome to the Streamlit community!

When the file_uploader widget is used, no file is actually created. The return value is a BytesIO object, which stays in RAM. If you’d like to save that file somewhere, you can choose to do so.

Best,
Randy

1 Like

Thank you for the welcome, Randy.

I understand the current operation of the file_uploader widget and I am using it in my app now! What I would like to have, in addition to the StringIO (in my case), is the path & file name that was selected by the user. The current file_uploader() does not appear to support such a return option but I wanted to find out if there were some other way. Or, how do I go about making an enhancement request to the library (I am new to this so please bear with me). Thank you for your quick reply!

greg

I am having the same issue.

1 Like

Having same issue with the file_uploader , can’t access the file name,… and need to send it to a flask api
two files and a string, have issue understanding how the uploader works really :roll_eyes: