0
0
Firebasecloud~10 mins

Why file storage is needed in Firebase - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize Firebase Storage in your app.

Firebase
const storage = [1]();
Drag options to blanks, or click blank then click option'
AgetStorage
BgetFirestore
CinitializeApp
DconnectStorageEmulator
Attempts:
3 left
💡 Hint
Common Mistakes
Using initializeApp instead of getStorage
Confusing Firestore with Storage
Trying to connect emulator before initializing storage
2fill in blank
medium

Complete the code to upload a file to Firebase Storage.

Firebase
uploadBytes([1], file).then(() => console.log('Uploaded'));
Drag options to blanks, or click blank then click option'
AauthRef
BstorageRef
CdatabaseRef
DfirestoreRef
Attempts:
3 left
💡 Hint
Common Mistakes
Using Firestore or database references instead of storageRef
Passing the file object as the reference
3fill in blank
hard

Fix the error in the code to download a file URL from Firebase Storage.

Firebase
getDownloadURL([1]).then(url => console.log(url));
Drag options to blanks, or click blank then click option'
AdatabaseRef
BauthRef
CfirestoreRef
DstorageRef
Attempts:
3 left
💡 Hint
Common Mistakes
Using Firestore or database references instead of storageRef
Passing an uninitialized variable
4fill in blank
hard

Fill both blanks to create a reference to a file named 'image.png' in Firebase Storage.

Firebase
const [1] = ref([2], 'image.png');
Drag options to blanks, or click blank then click option'
AstorageRef
Bstorage
Cfirestore
Ddatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Using Firestore or database instead of storage
Mixing variable names
5fill in blank
hard

Fill all three blanks to delete a file named 'oldfile.txt' from Firebase Storage.

Firebase
const [1] = ref([2], '[3]');
deleteObject([1]).then(() => console.log('Deleted'));
Drag options to blanks, or click blank then click option'
AfileRef
Bstorage
Coldfile.txt
DstorageRef
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names
Passing wrong file name
Confusing storage and storageRef