I'm new to react, my objective is to upload file and should get the filepath i.e., if i upload file from D drive then the path should be "D:\files\hi.pdf" but here neither i could upload the file nor i could get the path. I have gone through the link How to resolve the C:\fakepath? I tried to apply in my code but didn't worked out.
Here is the code:
<>
<div className="fileInput">
<Input
type="text"
placeholder="File 1"
id="file-path"
readonly
name="fileName"
value={this.state.fileName}
/>
<Input
type="file"
id="file-id"
name="file"
onChange={this.FileUpload}
/>
<Button icon="paperclip" />
</div>
<Button onClick={this.handleSubmit}>Submit</Button>
</>
Can anyone please help me in uploading and getting path while uploading file?