Home > Blockchain >  Store a User Image with Firebase
Store a User Image with Firebase

Time:12-28

I have a profile image specific to each user's profile within my app and I want this image to be stored within Firebase. What would be the standard way of doing this? Would I convert the image to binary then store it in Firestore along with my other user specific information?

Thank you!

CodePudding user response:

As you can see from here: https://cloud.google.com/firestore/quotas , maximum size for a document is 1 MiB which is probably far less than a profile picture's size. Therefore, Firestore is not the correct solution for storing images. What you can do is store the image in Firebase Storage then pass the storage location as a value to Firestore.

For example after you upload a picture to storage, you can see from the console that storage location is something like : gs://{bucket-name}/profile_picture.jpg . To see the picture in your browser you can enter the url of this file: https://{bucket-name}/profile_picture.jpg to your browser.

  • Related