AxiosError: Request failed with status code 403

使用streamlit的文件上传组件file_uploader时,如果上传文件时出现以下错误:
AxiosError: Request failed with status code 403

解决方法如下:

1.在运行目录下创建.streamlit文件夹;

2.在.streamlit文件夹下创建config.toml文件,文件内容如下:

[server]
enableXsrfProtection = false
enableCORS = false

3.重新执行streamlit run x.py

 

posted @ 2024-02-22 17:34  jingsupo  阅读(559)  评论(0编辑  收藏  举报

欢迎光临