Upload Files to Streamlit App

Hi Karl.

Great questions!

#1: How to create a file selector

Currently, there is no file picker, but I just added a feature request for one. Please feel free to follow this request on Github to follow its progress.

In the meantime, here’s an example of a janky ad-hoc file selector on the server:

import streamlit as st
import os

filename = st.text_input('Enter a file path:')
try:
    with open(filename) as input:
        st.text(input.read())
except FileNotFoundError:
    st.error('File not found.')

#2: How to inject custom HTML into Streamlit

What would you like to add? Streamlit already supports many different elements and we’re adding more each day. If you share some details we can help you achieve your aim.

In the long run, we plan to expose a plug-in architecture. I’ve created this tracking bug. Please feel free to add comments describing what you’d like to see here.

Summary

In general, please feel free to submit bug report or feature requests at our repo.

2 Likes