1
votes

I am trying to create an admin application that can select and upload an image to the Firebase storage and after that, I want the image URL to automatically reflect in the document that is sending data to the client-side application.

The only problem with this is that I only know how to upload an image to Firebase storage from the admin application. I haven't figured a way, as to how can I get the image URL into my document in Cloud Firestore.

Any suggestions or direction regarding this will be helpful.

I am using the flutter framework.

Database structure :

SkinTreatment :

"SkinTreatment": {
    "someDocumentName": {
      "title": "Threading",
      "packageDetails":"This package will provide you with normal upper EyeBrow Threading",
      "price" : "200"
      "duration": "75mins"
    },
    "someDocumentName2": { ... },
    "someDocumentName3": { ... }
}
1
If you post database structureAshish

1 Answers

1
votes

You can certainly write code to write the path and/or URL of a file in Cloud Storage to any database. If you have a StorageReference object representing a file that was uploaded, you can use its getPath() method to get a path to the file in storage, and you can use getDownloadUrl() to asynchronously get a download URL as well.

For help writing data to Firestore, there is plenty of documentation.