How do I increase the upload limit of st.file_uploader on Streamlit Community Cloud?
By default, files uploaded using
st.file_uploader() are limited to 200MB. You can configure this using the
server.maxUploadSize config option.
Streamlit provides four different ways to set configuration options:
- In a global config file at
~/.streamlit/config.tomlfor macOS/Linux or
[server] maxUploadSize = 200
- In a per-project config file at
$CWDis the folder you're running Streamlit from.
STREAMLIT_*environment variables, such as:
- As flags on the command line when running
streamlit run your_script.py --server.maxUploadSize 200
Which of the four options should you choose for an app deployed to Streamlit Community Cloud? 🤔
When deploying your app to Streamlit Community Cloud, you should use option 1. Namely, set the
maxUploadSize config option in a global config file (
.streamlit/config.toml) uploaded to your app's GitHub repo. 🎈
For example, to increase the upload limit to 400MB, upload a
.streamlit/config.toml file containing the following lines to your app's GitHub repo:
[server] maxUploadSize = 400
- Streamlit drag and drop capping at 200MB, need workaround
- File uploader widget API
- How to set Streamlit configuration options