1

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 structure Commented Oct 29, 2020 at 4:41

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much for the documentation, will go through them.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.