I'm trying to use material UI upload button, to allow my users to upload profile images, so it looks like this:
<label htmlFor='icon-button-file'>
<Input accept='image/*' id='icon-button-file' type='file' onChange={handleCaptureChange('profileImg')} />
<IconButton
color='secondary'
aria-label='upload picture'
component='span'
>
<StyledUploadButton />
</IconButton>
</label>
and this:
const handleCaptureChange = (prop: keyof State) => (event: React.ChangeEvent<HTMLInputElement>) => {
setValues({
...values,
[prop]: event.target.value
})
}
the URL I receive whenever I tries it, and select an image will be like this: C:\fakepath\b062f046-fcb5-4c99-bd19-1fff9c11efed.jpg and this image is on my desktop, that's weird, how should I get the right location of the image?