I just had an error when upload a xlsx file. it shows error " AxiosError: Request failed with status code 500". My app is working well on 7/27 but there must be some overnight changes that trigger this one.
The strange thing is there is NO error if I run it on Firefox. Chrome and Edge both have this error…any help? And I tried to downgrade to version 1.23 and 1.24, both are not working.
Having the same issue. I have 2 separate frontends (one is react hosted on AWS amplify and the other is nextjs hosted on vercel). Each embeds a streamlit app, which itself requires a file upload. Up till a few days ago, these were working normally. But for some reason, now I also get the same error - “AxiosError: Request failed with status code 500”. The timeline seems to match what @John_K reported above. Is this a streamlit cloud side issue or something I have to change in my app?
Same story here, upload form is working on Firefox but not on Chrome/Edge (on Windows 10, but other users experienced the same behaviour on mobile browsers).
I’ve tried this feature out and it works fine on React or Next-based interfaces. Feel free to check out my project here with that same feature enabled: https://pneumoscan.vercel.app/
The code chunk I used to embed it had an api query of embedded set to true: > <iframe
Some feedback from @kajarenc, one of our Software engineers:
After investigation, my best understanding is that file_uploader fails for apps deployed in Streamlit Cloud because of a misconfigrued _xsrf token, the interesting thing is that xsrf protection is disabled for all Cloud apps, but for some reason old apps still running with --enableXsrfProtection=true and just rebooting it doesn’t change it. But creating a container from scrach (attempt to deploy that app with a different domain?) solves that problem.
So the solution for Streamlit Cloud apps will be either try to redeploy the app (not just reboot), or explicitly specify:
[server] enableXsrfProtection = false
in app config.toml
If you’re still facing the issue, could you please try one of these solutions?
This method did not help me, I have the application running locally on the server and inserted by container to the site, maybe there are some other ways to solve in my case?
I started learning Streamlit recently. While trying to implement a very simple file uploader application locally, I am getting the same error. Sharing the code and the error too.
Streamlit version 1.30.0, OS Windows 8.1
File upload tutorial
#core packages
import streamlit as st
File processing packages
from PIL import Image
#load images
#@st.cache#used to make the load process faster
def load_image(image_file):
img=Image.open(image_file)
return img
def main():
st.title(“File upload tutorial”)
menu=[“Home”,“Dataset”,“DocumentFiles”,“About”]
choice=st.sidebar.selectbox(“Menu”,menu)
if choice==“Home”:
st.subheader(“Home”)
image_file=st.file_uploader(“Upload Images”,
type=[“png”,“jpg”,“jpeg”])
if image_file is not None:
st.write(type(image_file)) #methods/attributes #st.write(dir(image_file))
file_details={“filename”:image_file.name, “filetype”:image_file.type,“filesize”:image_file.size}
st.write(file_details)
st.image(load_image(image_file),width=250,height=250)