File_uploaded - preload with directory contents

When initialising the file_uploader widget, is there a way to “preload”, which means to show a list with the existing files in the uploaded directory? Thanks for any support!

uploaded_files = st.sidebar.file_uploader(“Choose a file to upload, files will be overwritten!”, accept_multiple_files=True, type=[“pdf”,“docx”,“doc”, “txt”,“rtf”], )

for uploaded_file in uploaded_files:
if uploaded_file is not None:
## Creates a file in writing mode
with open(“./Documents/uploaded/”+uploaded_file.name,‘w+b’) as tempFile:
## Writes the SGY to the file
temp.writeFile(uploaded_file.getbuffer())

You can show a list of anything at any time. You can use pathlib to create a list of file names.

from pathlib import Path

l = [path.name for path in Path("./Documents/uploaded").iterdir()]
st.write(l)