Angularfire: How do you Delete file from Firebase Storage

Created on 11 Jun 2018  路  1Comment  路  Source: angular/angularfire

Version info

Angular: 6.0.3

Firebase: 5.0.4

AngularFire: 5.0.0-rc.10

Other (e.g. Ionic/Cordova, Node, browser, operating system): Windows

How to reproduce these conditions

Steps to set up and reproduce

this._storage.ref(PATH_TO_FILE).delete();

Debug output

* Errors in the JavaScript console *

FirebaseStorageError聽{code_: "storage/invalid-argument", message_: "Firebase Storage: Invalid argument in 'ref' at ind鈥hild path but got a URL, use refFromURL instead. ...}

Expected behavior

To delete the file without an error

Actual behavior

Not deleting the file and throws an error


_Related to #1687_

Most helpful comment

It works like this

this._storage.storage.refFromURL(post.coverPic).delete()

>All comments

It works like this

this._storage.storage.refFromURL(post.coverPic).delete()
Was this page helpful?
0 / 5 - 0 ratings