Having some trouble with my code as it does not seem to log the download URL of the file being uploaded. I am getting this error message:
GET ...{URL that is not the download URL}... 404()
This is the code snippet in question.
//Get image
var file = a.target.files[0];
//create a storage reference
var storageRef = firebase.storage().ref('images/' + file.name);
//store the image
var task = storageRef.put(file);
var storage = firebase.storage();
storageRef.child('images/'+file.name).getDownloadURL().then(function(url) {
console.log(url);
}).catch(function(error) {
// Handle any errors
});
Any ideas on how to successfully retrieve the download URL?