Can't log path of uploaded images outside of foreach loop

I simply want to get download urls from firestorage and push it to empty array. In handleSubmit I try this but it logs empty array.. if I try it inside it logs correctly let images = []; thumbnail.forEach(async (file) => { const uploadPath = `property/${user.uid}/${file.name}`; const imgRef = ref(storage, uploadPath); await uploadBytes(imgRef, file); images.push(await getDownloadURL(imgRef));… Read More Can't log path of uploaded images outside of foreach loop

Can Firebase Storage rules validate against Realtime Database data?

I’ve seen from this post (https://firebase.blog/posts/2022/09/announcing-cross-service-security-rules) that you can validate Storage rules against Firestore data, however, I can’t find any information if you can do it for Realtime Database. >Solution : Riiight at the bottom of the post, the last paragraph says: So there you have it. That’s our shiny new feature. Try it out… Read More Can Firebase Storage rules validate against Realtime Database data?

Counting the number of files stored in Firebase Storage will count as a Storage Operation?

I’m wondering if the following code snippet will count as a Firebase Storage operation which could affect the costs regarding the FireBase Pricing plan? Future<void> countFiles() async { // Create a reference var storageReference = FirebaseStorage.instance.ref().child("<directory-name>"); // Count the amount of files var fileList = await storageReference.listAll(); setState(() { _fileCount = fileList.items.length; }); >Solution :… Read More Counting the number of files stored in Firebase Storage will count as a Storage Operation?

i wanna save my uploaded images in a folder firebase storage

i wanna save my uploaded images in a folder called "course-cover" in firebase storage this is my code that saves uploaded images in the route of storage directly but instead of thet i wanna save them in the "course-cover" folder async function storeCoverCourse(coverCourse) { return new Promise((resolve, reject) => { const storage = getStorage(); const… Read More i wanna save my uploaded images in a folder firebase storage

Can I get file from Firebase Storage while not knowing one child path?

I have this file path from Firebase Storage that I want to download: /students/ekljfbwekncwlkjbweclk/gpas/this part is random/4 If I do not know the child path "this part is random", can still download the file? I tried this: firebaseStorageStudentRef.child("ekljfbwekncwlkjbweclk").child("gpas") // This is what I tried .child("*") .child("4").downloadUrl.addOnSuccessListener { uri -> Log.i(TAG, "Success! Uri is: $uri") }.addOnFailureListener… Read More Can I get file from Firebase Storage while not knowing one child path?

Download and display image from firebase

I am trying to display a users image on their profile page but I don’t know how to download the image from firebase 🙁 this is how I saved the image:: await AuthService.firebase().createUser( email: _email.text, password: _password.text, ); final userId = AuthService.firebase().currentUser?.id; final destination = ‘user-profile-image/$userId’; // here is the location final ref = FirebaseStorage.instance.ref(destination);… Read More Download and display image from firebase

How to upload a Video from FileManager to Firebase storage?

I am trying to upload a video to firebase storage that is saved in FileManager as a URL looking like this file:///Users/admin/Library/Developer/CoreSimulator/Devices/D9BA697D-2ACA-4C4F-BE64-9004016A8500/data/Containers/Data/Application/1133A56A-B92F-4A8A-B9D9-0A8180607B93/Documents/videorecording.mp4. I tried uploading it like this: private func persistVideoToStorage(id: String, video: URL) { let ref = FirebaseManager.shared.storage.reference(withPath: id) ref.putData(video, metadata: nil) { metadata, err in if let err = err { print(err) return… Read More How to upload a Video from FileManager to Firebase storage?

Why is (list.length == otherList.length) showing false – Flutter

I have a List<File> imageFiles made up of files that a user selects and when they press submit, each of the files is uploaded to the collection in Firebase Storage. For each one, the downloadUrl is added to another list uploadedImages. I cannot upload the document to Firestore until all the downloadUrls are added to… Read More Why is (list.length == otherList.length) showing false – Flutter