Q: React Upload Images Object Not Found I am trying to upload images to Firebase but it is very inconsistent. I am trying to upload multiple photos but am unsure how to loop through the images array and upload properly so I went with uploading one at a time. It works sometimes but most times it says :
code: 404
message: "Not Found.  Could not get object"
status: "GET_OBJECT"

This is my upload code:
const onUpload = async () => {

    const file = campaignImage
    const storageRef = storage.ref()
    setLoading3(true);
    const fileRef =  storageRef.child(file.name)
    setUrl(await fileRef.getDownloadURL())
    await fileRef.put(file)
    
    db.collection("campaigns").doc(campaignName).update({
      images: firebase.firestore.FieldValue.arrayUnion({
        name: file.name,
        url: await fileRef.getDownloadURL()
      })
      
    })
  

