I am building an application that lets users share files between themselves by uploading it to their profiles. To do this, i have a component called AddReport which initializes a title and file state using useState(), and then renders a form with an input for both title and files upload. the input for the title has a value prop of {title}, and since i can not do same for the file input, how do i collect the uploaded file from the form and store it in a new object that has both the title value and the file value so that upon the submission of the form the user inputs can be sent to a database using a useEffect() call with axios?
<form onSubmit={handleUploadSubmit} >
<div>
<label>Title</label>
<input
type="text" placeholder="|Add a title "
onChange={handleTitle} value={title}
/>
</div>
<div>
<input type="file"
onChange={uploadHandler}
/>
<p className='p-2 mx-[70px] text-sm'>Add Report files(PDF, JPG, PNG)</p>
</div>
<button
onClick={handleUploadSubmit}
>
<span className='px-[10px] '>Upload Report</span>
</button>
</form>