Images taken with Camera not shown up when we open app from another mobile/laptop


I believe that ‘camera’ component stores the local path of image. That is why when I try to see the saved photo from any other device, the photo does not show up.
Correct me if I’m wrong.

So if this is the case, is there anyway to make the picture taken and show it up ‘globally’. Like it is visible when the app is opened from any device?

1 Like

Please show your code. Where are you storing the image?

1 Like

You need to use Cloudinary with Media DB to save images not Firebase.

As far as I understand, media db just returns a media url, and in the docs it mentions cloudinary is not mandatory , but should be used as a safe measure for privacy of your pics.

Here, I used firebase to save images corresponding to a user email.

1 Like

So can you explain where are you saving the actual image and where are you saving the URL of the image?

If you want to save the image to Firebase you then need to convert it to Base64 before saving the image to Realtime DB.

See this post

umm… the algorithm is like…
when user clicks on snap button - > call camera → upload the photo to media url to get url → save this url (key) against an email id (value) in firebase

Point is, it is working if I snap using mobile ‘x’, but if I open the app using mobile’y’, the image doesn’t show up.

I’ll go through the doc which you have referrerd, Thanku so much for replying.

1 Like

To have your image accessible by other users, you have to save the image on a cloud storage that the users can reach. Where are you saving the image to get the URL from the saved image.

Please note, I am not talking about the upload URL, I’m taking about the URL generated after uploading the image to the general repository.

Right. You’re saving the value of the green Photo block which is the actual image file. You should be saving the green mediaURL block instead which is the text url for the hosted image.

1 Like

Oh oki, so you are saying that I need to attach ‘media url’ block as value while saving to realtime database, correct?

I did that, and the value saved is coming like - “file:///storage/emulated/0/Pictures/image-b4762…”

Point is, have to upload the image in cloud somewhere (not the url), as the path shows local storage… so that it is accessible globally?

1 Like

I’ll explain again. To have your image accessible by others, you need to store it in a place in the internet that can be reached by others.

This is the URL which Media DB will use to upload the image to Cloudinary and then return to you an internet URL that can be reached by others,

You are missing the storage and using the URL for your local phone which will only be accessible in the phone that used to take the image.

Hope this is clear.

Got it now!

Thankyou so much for your patience!

That solves my issue. So after user clicks on photo, we need to upload it to a common place on net…like google drive or something…n then maybe use media db.

Please clarify if i went wrong again :sob:

1 Like

Yes. I use Cloudinary for that:

Think of Media-DB as an upload tool so it will be used after taking the picture from the camera (or selecting from the Gallery) and before uploading to the common storage.

Thanku so much both of you!

1 Like