0

I am saving the download url from getDownloadUrl method in database to later use as image src. The image shows correct src in the view source but the image is not loaded.

<img src="https://firebasestorage.googleapis.com/v0/b/social-snap-1bdbd.appspot.com/o/images%2F614d7b76e842ab0c54eb6748.jpg?alt=media&amp;token=8207cf33-e239-4ff7-9f08-4f7d6fac0a99" alt="user" class="w-full h-full object-cover"></img>

I Have also enabled public access to the storage bucket but It is still not working.

Puneet56
  • 126
  • 1
  • 9

1 Answers1

1

If you are trying to use it on a webpage it is probably a CORS configuration problem. You have to add CORS policy to your header.

For this you can follow this answer: https://stackoverflow.com/a/58613527/5292951

If you want to allow CORS from any website just use origin ["*"], otherwise specify your domain.

Dharman
  • 30,962
  • 25
  • 85
  • 135
gbaccetta
  • 4,449
  • 2
  • 20
  • 30