title: Photo Upload Validation with React
body: <p>I have this small issue
  I am using Ant Design and its components
  <a href="https://ant.design/components/upload/" rel="nofollow noreferrer">https://ant.design/components/upload/</a></p>
  
  <p>I am trying to upload images, and it all works fine, But i need to add a validation to verify if the file is correct. That is if a user renames any other file to a <code>.jpg</code> or <code>.png</code> extension, i need to validate that and show them an alert.</p>
  
  <p>How can i achieve that, Currently we convert the image in base64 using FileReader</p>