Skip to content

Conversation

snehankekre
Copy link
Contributor

This PR adds a KB article on how to increase the upload limit of st.file_uploader in apps deployed to Streamlit Cloud. The solution is to set the appropriate config option in a global config file and upload said file to the app's GitHub repo.

This article was inspired by this forum thread.

@randyzwitch
Copy link
Contributor

Feels like the answer could be #1 or #2 here...you could either make a .streamlit folder, or put a config.toml file at the top level of the repo. I wonder if Cloud has a preference on which to say.

@snehankekre
Copy link
Contributor Author

Feels like the answer could be #1 or #2 here...you could either make a .streamlit folder, or put a config.toml file at the top level of the repo.

You're right! I completely overlooked option 2. I've seen repos that use option 2 as well. Will run it by Cloud and make changes to this PR.

@snehankekre
Copy link
Contributor Author

you could either make a .streamlit folder, or put a config.toml file at the top level of the repo

When deploying to Streamlit Cloud

@randyzwitch AFAIK to be used, a config.toml file has to exist within a .streamlit/ folder. That folder should exist at the top level (root) of the repo, regardless of the location of the app app.py.

If the app is in a folder dir/app.py, the config file should be .streamlit/config.toml, not dir/.streamlit/config.toml.

To verify, I created a this repo and app:

  • app.py and .streamlit/config.toml are within dir/
  • Notice how the app does not use the custom (dark) theme defined in the config.
  • It picks up the theme only when .streamlit/config.toml is moved out of dir/ to the root of the repo.

Takeaway is that option 1 is still the correct answer. WDYT?

@randyzwitch
Copy link
Contributor

Thanks for confirming @snehankekre, #1 seems like the answer :)

@randyzwitch randyzwitch merged commit 26ceff3 into main Dec 9, 2021
@randyzwitch randyzwitch deleted the kb-upload-limit branch December 9, 2021 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants