Flutter Error : [firebase_storage/unknown] location should not be a full URL

I am trying to delete a file with a URL from FirebaseStorage and while deleting it I am receiving this error.

Code

Future<void> deleteImage(String imageUrl) async {
    
    try {
      await FirebaseStorage.instance.ref(imageUrl).delete();
    } catch (e) { 
       debugPrint('Error : $e'); 
    }

}

I want to delete the image with given imageUrl. How can I achieve this..?

My imageUrl sample: https://firebasestorage.googleapis.com/v0/b/flutter-8bd46.appspot.com/o/post_394be2ba-592c-45c9-9dab-fd72920f7afe.jpg?alt=media&token=98801435-192b-4ec1-b8e1-e73bac0bb9eb



from Recent Questions - Stack Overflow https://ift.tt/3jbM8mK
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)