title: Firebase Uploading Data to realtime database Everything does not show up
body: <p>I am trying to upload a IMG files from my computer to my Firebase Realtime Database I have the image location stored inside of a json array and it includes the other details of the data I want to upload im wondering how I can upload the img to firebase and get the download url . I currently have something working only problem is that the images upload but only 1 or 2 objects will show up in real time database other than the expected number of 9</p>
  <pre><code>function makeCustomersHappy(){
      var count = 0;
      fetch(&quot;./upcominTasks.json&quot;)
      .then(response =&gt; {
          return response.json();
      })
      .then(jsondata =&gt;{
          jsondata.forEach(position =&gt; {
              alert(count)
              count+=1;
  
              var imageName = JSON.stringify(position.name).replaceAll('&quot;','')//neccesary for storing data
              var urlLink = JSON.stringify(position.url).replaceAll('&quot;','')
              var itemName = JSON.stringify(position.name).replaceAll('&quot;','')
              var store = JSON.stringify(position.store).replaceAll('&quot;','')
  
              //get item name 
              document.getElementById('sometext').textContent = imageName;
              document.getElementById('upIMG').src  =  `./dropImages/${imageName}.jpg` //change image 
              //names the image for storage ref
              const storageRef = sRef(storage, `upcomingTasks/${imageName}.jpg`);
  
              var imgAddress = fetch(`http://127.0.0.1:5500/puppetBots/dropImages/${imageName}.jpg`)
              .then(function(response) {
                  return response.blob()
              }).then(function(img_blob) {
                  //location.reload()
                  //uploads the image to firebase
                  uploadBytes(storageRef,img_blob ).then((snapshot) =&gt; {
                      //the image that we just uploaded we get the  dowload url....                        
                      getDownloadURL(sRef(storage, `upcomingTasks/${imageName}.jpg`))
                      .then((img_url) =&gt; {
                            writeUserData(count,itemName,urlLink,img_url,store)                
                      });
                  });
              });
          });              
      });    
  }
  
  async function writeUserData(id, name, url, imgLink,store) {
      const db = getDatabase();
      //id is basically the loop we are currently at
      set(gRef(db, 'UpcomingDropLinks/' +id), {
          ImageUrl: imgLink,
          ItemName: name,
          ItemUrl : url,
          Store:store
      });
  }
  makeCustomersHappy()
  </code></pre>