When I hit upload the picture gets uploaded to firebase Storage, but i cant seem to get the image url, I can go to the Storage tab on firebase click on the image and click on its ling , copy the link in and then past it into the DATABASE were i need it for display and it will work, But i dont see an image URL or A download URL when i consolo.log the snapshot of the const TASK!
I fear that the method:
“const task = uploadBytesResumable(storeref, ImSRC, metdata)”
that iam using to upload the image does not produce an image url! Could This be So?
!!!HERE IS ALL THE CODE FOR THE UPLOAD BUTTON !!
Upload.addEventListener(‘click’, (e) =>{
let ImSRC = files[0];
if(ImSRC == null ){
alert('no picture selected');
}else{
const metdata = {
contentType: ImSRC.type
}
const storeref = sRef(storage,"UsersProPic/" + cUserID);
const task = uploadBytesResumable(storeref, ImSRC, metdata).then((snapshot)=>{
let PicUrl = snapshot;
function getData(PicUrl){
PicUrl.getDownloadURL.then((url)=>{
ProPicUrl = url;
})
}
console.log(ProPicUrl);
});
//update(ref(database, 'PickPlay/' + 'Users/' + cUserID),{
// imurl : ProPicUrl
//})
}
});
