Flutter CORS with Firebase Image Upload for Web App

Created At: 2024-11-17 12:17:51 Updated At: 2024-11-17 12:23:12

Here we will see how to set up CORS (cross origin resource sharing). Here we will be showing for Flutter based web app, but the same principle applies for react or any other framework like Laravel or Django.

Here we just show how to work CORS policy if your images are hosted on Firebase. 

Watch the complete video below for better understanding.

Make sure you have cors.json file in your root folder. And but the code below in it

[
{
"origin": ["*"],
"method": ["GET"],
"maxAgeSeconds": 10600
}
]

Once you run the above command, you will see the below output 

Once ou see the above command, you CORS set up is successful.

Comment

Add Reviews