File Uploader for each page

Hi, I am actually building a data app and wants it to allow me to use a file_uploader for different pages. But there seems to be conflict between the pages since the dataframe that come from differents excel files are not the same.
Here you can see an example of what it can display when you jump from one page to another:



Here you can check what the code looks like on my github repository:

I would be grateful if someone could help me resolve this problem, without having to condensate all on a single page app, thank you.

I think the problem is that the file_uploader key defaults to the same value across your pages, which is odd as you’d expect a DuplicateWidgetID exception.

Try specifying a different key for each st.file_uploader, for instance:

in 01_hvi.py:

uploaded_fhvi = st.file_uploader('Choissez un fichier', type=['xlsx', 'xlsb'],key="hviFile")

in 03_radar.py:

uploaded_fradar = st.file_uploader('Choissez un fichier', type=['xlsx', 'xlsb'],key="radarFile")

in 04_it.py

uploaded_f = st.sidebar.file_uploader("Choose xlsx file", type=['xlsx', 'xlsb'],key="itFile")
2 Likes

Hi mate, works perfectly fine now. Can’t thank you enough.