AxiosError: Request failed with status code 403 when trying to upload a file

@tonykip Thank you for the quick response!

Yes, the file upload works if the XSRF protection is turned off.
I also did the other steps later in the thread

  • Inspect the server logs for detailed error messages.
  • Update Streamlit to its latest version.
  • Reboot the app.
  • Ensure the CORS configuration on your local server is correctly set up.
  • Verify there are no network restrictions or firewalls blocking requests.
  • Test the app across different browsers to spot browser-specific issues.

However, it’d be much preferable to have XSRF protection, as noted i.e. in
When to use enableCORS and enableXsrfProtection parameters? and Enable server-side CSRF guards and add support in file uploader client · Issue #1524 · streamlit/streamlit · GitHub

All help is much appreciated.
Please let me know if I can do anything to assist with debugging this issue.