I’m writing a streamlit app and using the st.file_uploader() to upload video files (mp4 or mpeg). When I try to upload files larger than 100mb, I get a network error. This happens both when the app is run locally and when it’s run remotely.
I already tried to increase the maxUploadSize, that didn’t change the behavior.
I have 2 questions:
Does anyone have an idea how I could fix the issue?
How can I have a deeper look into the error? Are there logs etc?
Here’s a minimal example of an app producing the network error when trying to upload files larger than 100mb:
import streamlit as st
st.title("A toy app to test things")
st.write("Upload your video")
file_buffer = st.file_uploader("Upload a video", type=["mp4", "mpeg"])
About the use case: The scenario is about a user that wants to process and visualize data that they have on their local machine. Hence the upload. After that, the video is processed by a neural net and the results are provided for download and visualized.
For video files, such a limitation (100MB in my case, 50MB in the issue you linked), is quite bothersome because the files are pretty large.
I’m not sure if the linked issue is the same problem though.
i have the same problem, i can’t upload file larger than 100mb and got this kind of error. i already use server.maxUploadSize but still got this error. Does anyone know how to fix this error?
here’s the code when i got the error (for testing stuff):
import streamlit as st
uploaded_files = st.file_uploader('Choose your video', type="MP4")
if uploaded_files is not None:
video_bytes = uploaded_files.read()
st.video(video_bytes)
I spoke with one of our internal engineers, and they suggested first to check the version number of Streamlit you are using. In version 0.57.0, the limit was raised to 200MB and some of the logic was also changed. The current version of Streamlit is 0.59.0, so if you can first upgrade to see if that fixes the problem, that would be great.
If not, let me know and we’ll figure out something else to try.
(cc: @evah since it’s the same problem and potential solution)
unfortunately my streamlit version already 0.59.0, i already tried to re-install streamlit but still got an error. i tried to upload file more than 200mb (without server.maxUploadSize) and got different warning (a normal one i guess). the warning i got from uploading file between 100mb - 200mb and larger than 200mb is quite different (without server.maxUploadSize), if using server.maxUploadSize i only got the error 400
Hi @bruhtus and @evah, thanks for your patience. I generated some test video files today along with a clean Streamlit environment with 0.60 on Ubuntu 18.04 and I can confirm the behavior you are seeing. I will send a note to our engineers and see if they can identify what the issue is.
Hi @evah@bruhtus, we have just released a fix for this in 0.62. Please upgrade and take a look. If you are still encountering any issues, please let us know.
I’ve just got this error running the script from Windows Server. Streamlit 0.63.1 is installed. Have no idea why the file size is limited to 200MB. On Mac everything works just fine
Hi @jamie, just wanted to clarify, are you getting an error when uploading a file larger than 200MB or larger than 100MB? 200MB is our default upload size limit that can be updated using the server.maxUploadSizeconfiguration option.
Hi @karriebear, thanks for your reply. Yes, I am setting the server.maxUploadSize to 1024. Still, the error appears when I try to upload files with sizes greater than 200 MB
That’s interesting. Could you share which error you are receiving?
Also could you try running streamlit config show and confirm that the configuration option maxUploadSize has been set to 1024? We have several manners to read in configuration options and perhaps it may be overwritten somewhere?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.