0
I am doing a photo upload to firebase Storage, everything goes well, the file is transferred and recorded inside. But when I sign up within the task I can’t get the image download url to record to a variable and send to the bank later.
What’s returning to me is this at the moment:
My job is this::
uploadFoto(){
if(this.blobFotoPerfil){
const ref =
this.afs.ref(`profissionais/${this.nomeUsuarioPastaStorage}/perfil.jpg`);
const task = ref.put(this.blobFotoPerfil);
this.percentualProgresso = task.percentageChanges();
task.snapshotChanges().subscribe( data => {
console.log(data.downloadURL);
console.log(data.ref.getDownloadURL());
console.log(data.ref.fullPath);
})
}
The getDownloadURL() method returns me that C there on the console, and inside it has the photo url, however I do not know how to access it.
Try
C.i
orC['i']
ordata.ref.getDownloadURL()['i']
... etc.– GustavoAdolfo
Resolved as follows: uploadFoto(){ if(this.blobFotoPerfil){ const ref = this.afs.ref(
profissionais/${this.nomeUsuarioPastaStorage}/perfil.jpg
); const task = ref.put(this.blobFotoPerfil); this.percentualProgression = task.percentageChanges(); task.snapshothangeChanges(). subscribe( data => { data.ref.getDownloadURL().then( data => { this.professional.urlFotoPerfil = data; console.log(this.professional.urlFotoPerfil); }) }) 
 a; }– Diego Estacho