use
streamlit run main.py --server.enableXsrfProtection false
This should work if you are on working locally
use
streamlit run main.py --server.enableXsrfProtection false
This should work if you are on working locally
Thanks, Iām hoping I have now got round this
What do you mean by āadding authenticationā? The responders you list did not add any authentication, but rather disable XSRF - or did I miss something?
This error bugged the hell out of me. It usually happened after a redeploy of my app on GCP or revisiting a stale page. The browser keeps the XSRF cookie and no longer matches the server. The fix that worked for me was a hard refresh in the browser.
Thanks! After struggling with this error for 3 days, this thing solved my issue.
This worked for me! Thanks
Hey all, hey @Charly_Wargnier,
Weāre having the same issue with streamlit==1.35.0. The file upload works locally, but not on the deployed app, and throws the AxiosError: Request failed with status code 403
error.
Here are a few additional info:
About the solutions previously mentioned:
What happens under the hood in st.file_uploader? Do we know where this particular exception is thrown from and under what circumstances? Any idea to solve this would be much appreciated
I have exactly the same problem ā works locally but not on the deployed app. Have you been able to solve it?
No, not solved so far!
Itās so strange, I have been working on my app on my work computer for a while with no issues. I am now working on my personal computer and am getting this 403 error. I just finished the whole app build to realize this bug is now poping up?!?!!
Is there any update on this issue please? Still getting the error running Python 3.8.12 and Streamlit 1.35.0
Iāve raised it as an issue to Streamlit:
I put it enableXsrfProtection = false
into config.toml but it does not work for. O was troubleshooting for daysā¦
Finally i put ENTRYPOINT ["streamlit", "run", "./src/š _Home.py", "--server.port=8080", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
into my dockerfile and it works! streamlit version is 1.31.0
it works for me too, thanks a lot !
Thanks @Hugo_Angel,
I was trying to upload some images to s3, and after running with this flag it worked.
Actually, there are Python and Streamlit version compatibility issues. I also faced a similar problem, even when I tried to update my config.toml file too but I spent tons of time then got the idea that some versions of pythons do not fully support the dependencies of streamlit.
So far, I have installed the python version=3.12.4 and streamlit version=1.37.1, which allows all the dependencies to work smoothly, now all the file formats are uploading very smoothly without any problem.
Sadly even upgrading python to 3.12.4 doesnāt work for me.
Funny how things stopped working overnight without changing anything.
So far this works for me ā¦ but only locally:
streamlit run main.py --server.enableXsrfProtection false
Using streamlit 1.38.0 , uploading xlsx files locally without running any flags, the upload works smoothly.
using the following command:
import streamlit as st
uploaded_file = st.sidebar.file_uploader(āUpload your file hereā, type=āxlsxā) # my file uploader sits on a sidebar
File upload failed.
ā¢ There is a problem with your request. (403, 8d41fae42b951192-COK)
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.
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.
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.
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.