Hide file_uploader() bottom HTLM/Widget after an upload

Hello,

IĀ“ve created an app which needs to read multiple files at once. IĀ“m using the file_uploader() component with the parameter accept_multiple_files=True.

My question is if thereĀ“s a way to hide the bottom HTML/Widget that appears after uploading a file/s (see picture below)?

Hello @lucasmengual, welcome to the forum,

There was a similar question recently, and I think st.beta_expander is the easiest way to hide the file uploader without having to programmatically play with the rerunning script to see if files were added.

Would that fit your need?

Best,
Fanilo

1 Like

Hi @andfanilo, thanks for the feedback!

I checked the st.beta_expander() function, but the problem is like you mention it would hide the whole st.file_uploader(). But is there a way for me to only hide the extended section of the file_uploader() only?

Cheers,
Lucas

@andfanilo IĀ“ll be probably using the st.beta_expander() function for the moment :+1:

Maybe in the future you can consider adding a parameter like hide_extended=True in the st.file_uploader() for example to tackle this issue, specially when people use it to load lots of small size documents (i.e +100) and the extended window doesnĀ“t show ā€œShowing page 1 of 33ā€ :yum:

Cheers!

Ah I misread your problem, +100 documents wow thatā€™s a lot :slight_smile:

Could you create an issue on Github with your need, and linking back to this post for more context?

In the meantime you can cheat with css:

import streamlit as st

css = """
.uploadedFiles {
    display: none;
}
"""
# or `visibility: hidden;`

st.markdown(f'<style>{css}</style>', unsafe_allow_html=True)
files = st.sidebar.file_uploader("Choose files", accept_multiple_files=True)

Good luck!
Fanilo

3 Likes

@andfanilo, do you know how to change the number of files on a file_uploader showing page ?