Check out example codes for "how to store image in realtime firebase using angularfire2 and angular 8". It will help you in understanding the concepts better.

Code Example 1

if (file.type.match('image.*')) {
  // do something
} else {
  alert('invalid format!');
}

Learn ReactJs, React Native from akashmittal.com