Currently, I have a script that is responsible for uploading my image once the form is submitted.
updateUser(user: User, privateUser: PrivateUser, dob) {
//store img in storage
if(this.file){
var path = `users/${this.userID}/${this.file.name}`
var ref = this.storage.ref(path);
this.storage.upload(path, this.file);
this.downloadURL = ref.getDownloadURL();
this.refURL =this.downloadURL.subscribe(url => console.log(url) );
console.log(this.refURL);
}
}
I am currently working on saving the download URL as a reference point in Firebase. The script is successfully printing the desired output from
this.refURL =this.downloadURL.subscribe(url => console.log(url) );
. However, when I execute console.log(this.refURL);
, it returns a subscriber instead of the actual URL value. How can I proceed with storing the URL value in Firebase?