Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AxiosError: Request failed with status code 403 in streamlit

I am getting this error "AxiosError: Request failed with status code 403" while uploading image on streamlit app. this is my code screenshot of error

import streamlit as st
from PIL import Image

# Title
st.title('Image Viewer')

    #Upload an image
uploaded_image = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png", "webp"])

    # Check the type of the uploaded image
if uploaded_image is not None:
        # Open the image using PIL
        image = Image.open(uploaded_image)
        # Display the image
        st.image(image, use_column_width=True)

I checked all the necessary packages is installed along with tried running same project in newly created environment but it didn't solve anything.

like image 269
harsh Avatar asked May 14 '26 09:05

harsh


1 Answers

If you are running it locally try:

streamlit run app.py --server.enableXsrfProtection false

like image 62
Neelavdeep Bhagabati Avatar answered May 16 '26 22:05

Neelavdeep Bhagabati