0
0
Firebasecloud~10 mins

Uploading files in Firebase - Interactive Code Practice

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

Complete the code to create a reference to the storage location.

Firebase
const storageRef = firebase.storage().ref().[1]('images/photo.jpg');
Drag options to blanks, or click blank then click option'
Aupload
Bchild
Cget
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'upload' instead of 'child' to create a reference.
Trying to use 'get' or 'delete' before creating the reference.
2fill in blank
medium

Complete the code to upload a file to Firebase Storage.

Firebase
storageRef.[1](file).then(() => console.log('Upload complete'));
Drag options to blanks, or click blank then click option'
AgetDownloadURL
BlistAll
Cput
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'getDownloadURL' instead of 'put' to upload.
Trying to use 'delete' or 'listAll' which are unrelated to uploading.
3fill in blank
hard

Fix the error in the code to get the download URL after upload.

Firebase
storageRef.put(file).then(() => storageRef.[1]()).then(url => console.log(url));
Drag options to blanks, or click blank then click option'
Adelete
Bupload
Clist
DgetDownloadURL
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'upload' again instead of 'getDownloadURL'.
Trying to use 'delete' or 'list' which do not return URLs.
4fill in blank
hard

Fill both blanks to delete a file and then log a success message.

Firebase
storageRef.[1]().then(() => console.log([2]));
Drag options to blanks, or click blank then click option'
Adelete
B'File deleted successfully'
C'Upload complete'
Dput
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'put' instead of 'delete' to remove files.
Logging the wrong message after deletion.
5fill in blank
hard

Fill all three blanks to upload a file, get its URL, and log it.

Firebase
storageRef.[1](file).then(() => storageRef.[2]()).then([3] => console.log([3]));
Drag options to blanks, or click blank then click option'
Aput
BgetDownloadURL
Curl
Ddelete
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up method names or variable names.
Using 'delete' instead of 'put' or 'getDownloadURL'.