Server side file select

I would like to be able to select (browser and select) a file on a server side, so that after a file was uploaded to the server it can be just chosen rather then uploading it again next time. Moreover, the server has access to many files the client side does not have access to.

Hi @Hanan_Shteingart_IL

See this relevant post with a code snippet:

import streamlit as st
import os

def file_selector(folder_path='.'):
    filenames = os.listdir(folder_path)
    selected_filename = st.selectbox('Select a file', filenames)
    return os.path.join(folder_path, selected_filename)

filename = file_selector()
st.write('You selected `%s`' % filename)

The code was originally created by @Adrien_Treuille

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.