How do you retrieve the filename of a file uploaded with st.file_uploader?
If you upload a single file (i.e. accept_multiple_files=False), the filename can be retrieved by using the .name attribute on the returned UploadedFile object:
If you upload multiple files (i.e. accept_multiple_files=True), the individual filenames can be retrieved by using the .name attribute on each UploadedFile object in the returned list:
Related forum posts:
Still have questions?
Our forums are full of helpful information and Streamlit experts.
