I'm new to the reactjs, my objective is to upload a file in the form (form which contacts no.of data i.e., name, email, phone number, etc..), I couldn't able to figure it out how to upload the file. i mean in which format do i need to upload the file. In Backend, we're using iform file similar to this link "File upload with ASP.Net Core 2.0 Web API and React.js" and swagger looks in this way:
Here is the code:
<Form.Field>
<label>File upload </label>
<Button as="label" htmlFor="file" type="button" animated="fade">
<Button.Content visible>
<Icon name="file" />
</Button.Content>
<Button.Content hidden>Choose a File</Button.Content>
</Button>
<input
type="file"
id="file"
hidden
onChange={this.props.FileCheck}
/>
<Form.Input
fluid
label="File Chosen: "
placeholder="Use the above bar to browse your file system"
readOnly
value={this.state.fileName}
/>
</Form.Field>
Here is the sample one i just created for upload file only "https://codesandbox.io/s/red-feather-77v26".
When i click on submit it is showing unsupported media file. can anyone help me in this?


headers: { "Content-Type": "application/json" }just don't assign anything because normally axios itself would recognize it.. And also for file upload the content type ismultipart/form-data..formDataas data to the request..Content-Type..