Get URL Firebase Storage

0

I'm doing a web app which uploads images to Firebase Storage. The app uploads the images correctly but at the time of obtaining the URL of the image to download it gives me the following output:

Code that uploads the image to Firebase Storage and gets the URL:

function subirImagen(){
	var imgToSave = fichero.files[0];
	var uploadTask = storageRef.child('imagenes/' + imgToSave.name).put(imgToSave);

	uploadTask.on('state_changed', null,function(error){
        console.log('Error al subir el archivo', error);
    },
    function(){
		var imgURL = String.valueOf(storageRef.child('imagenes/' + imgToSave.name).getDownloadURL());
		console.log('Subida completada.');
		console.log(imgURL);
    }
  );	
}
    
asked by Joaquin gonzalez 07.12.2018 в 13:09
source

0 answers