Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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 :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Yes, listing objects is a billable operation. You will want to consult the Google Cloud documentation for details that:

When an operation applies to a bucket, such as listing the objects in a bucket, the default storage class set for that bucket determines the operation cost.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading