'How to upload image to firebase realtime database from storage link
I made a code to store listings posted on a website under the realtime database and I wanted to add the images to the realtime database. I added this code in the javascript
for (let i = 0; i < filess.length; i++) { storage.ref(refUUID + '/' + filess[i].name).put(filess[i]).then(() => { storage.ref(refUUID + '/' + filess[i].name).getDownloadURL().then(function (url) { db.ref(listingType + '/' + refUUID + '/Description/Images/Image' + (i + 1)).set({ Link: url, name: 'Image' + (i + 1) }) }); }); }
It worked initially but it doesn't anymore. Anyone know why this is?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
