Open client/src/components/upload/Upload.jsx. We'll start by examining the contents of the render() method:
<p><button id="upload" onClick={this.upload}>Upload Photo</button></p>
<div id="uploadForm" className="w3-modal"> <form method="post"
encType="multipart/form-data">
<p><input type="file" name="filetoupload" /></p>
<p><button type="submit" onClick={this.uploadForm}>Upload</button></p>
</form>
</div>
Great, it's a basic HTML form. The only parts of this that are React-specific are the click handlers. Let's look at the onClick method for the form: this.uploadForm. If we look at that method, we'll see the real functionality of our upload form:
uploadForm(e) {
e.preventDefault();
const formData = new FormData()
formData.append('file', document.querySelector...