0
0
Firebasecloud~10 mins

Download URLs 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 get a download URL from Firebase Storage.

Firebase
const storageRef = firebase.storage().ref('files/example.txt');
storageRef.[1]().then(url => {
  console.log(url);
});
Drag options to blanks, or click blank then click option'
AgetURL
BdownloadURL
CfetchURL
DgetDownloadURL
Attempts:
3 left
💡 Hint
Common Mistakes
Using a method name that does not exist like 'downloadURL' or 'getURL'.
Trying to access the URL directly without calling a method.
2fill in blank
medium

Complete the code to create a reference to a file named 'image.png' in Firebase Storage.

Firebase
const storage = firebase.storage();
const imageRef = storage.ref().[1]('images/image.png');
Drag options to blanks, or click blank then click option'
ArefChild
BgetChild
Cchild
Dfile
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like 'getChild' or 'refChild'.
Trying to pass the path directly to ref() without child().
3fill in blank
hard

Fix the error in the code to correctly get the download URL for 'docs/manual.pdf'.

Firebase
const ref = firebase.storage().ref('docs/manual.pdf');
ref.[1]().then(url => {
  console.log(url);
});
Drag options to blanks, or click blank then click option'
AgetDownloadURL
BdownloadURL
CfetchDownloadURL
DgetURL
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'downloadURL' which is not a method.
Trying to use 'getURL' or 'fetchDownloadURL' which do not exist.
4fill in blank
hard

Fill both blanks to create a reference and get the download URL for 'videos/clip.mp4'.

Firebase
const storage = firebase.storage();
const videoRef = storage.[1]().[2]('videos/clip.mp4');
Drag options to blanks, or click blank then click option'
Aref
Bchild
CgetDownloadURL
DstorageRef
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'storageRef' which is not a method.
Using 'getDownloadURL' in place of 'child' which is incorrect here.
5fill in blank
hard

Fill all three blanks to get the download URL for 'music/song.mp3' and log it.

Firebase
const storage = firebase.storage();
const songRef = storage.[1]().[2]('music/song.mp3');
songRef.[3]().then(url => console.log(url));
Drag options to blanks, or click blank then click option'
Aref
Bchild
CgetDownloadURL
Ddownload
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'download' instead of 'getDownloadURL'.
Skipping 'child()' and passing path directly to 'ref()' without chaining.