0

I want to upload the network image path to the storage. The image URL like https://firebasestorage.googleapis.com/v0/b/elderlyapp-b7344.appspot.com/o/MedImages%2FJkgWeoMvT1gYoa0YnBvxQU6qPef1_2024-04-01%2001%3A44%3A03.075256. Since I want to keep the first image when the first image deletes, I can also read the second image which same as the first image.

This is the function

 Future<String> uploadNetworkImage(String imagePath) async {
    try {
      final imagesRef = storage
          .ref("MedImages")
          .child("${currentUser}_${DateTime.now()}.jpg");
      await imagesRef.putString(imagePath, format: PutStringFormat.dataUrl);
      final String imageUrl = await imagesRef.getDownloadURL();
      return imageUrl;
    } on FirebaseException catch (e) {
      print(e);
      return "";
    }
  }

I want to upload network image to firebase storage

New contributor
fjf fjfj is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.