Storage bucket structure
📖 Scenario: You are setting up a Firebase Storage bucket to organize files for a photo sharing app. You want to create a clear folder structure inside the bucket to separate user profile pictures and shared album photos.
🎯 Goal: Build a Firebase Storage bucket folder structure with two main folders: profile_pictures/ and shared_albums/. Each folder will hold files for different purposes.
📋 What You'll Learn
Create a Firebase Storage bucket reference variable named
storage.Create a reference to the
profile_pictures/ folder named profilePicturesRef.Create a reference to the
shared_albums/ folder named sharedAlbumsRef.Add a configuration variable
maxFileSize set to 5MB (5 * 1024 * 1024 bytes).Write a function
uploadFileToFolder that uploads a file to a specified folder reference.Complete the upload function call to upload a file named
userPhoto.jpg to the profile_pictures/ folder.💡 Why This Matters
🌍 Real World
Organizing files in cloud storage buckets is essential for apps that handle user uploads, like photos or documents. Clear folder structures help manage and secure files.
💼 Career
Cloud engineers and app developers often configure storage buckets and write code to upload and manage files securely and efficiently.
Progress0 / 4 steps