'get file path from selected file in tsx

I am trying to get the full path file in .tsx

I have the follow code from a material ui that opens a windown to search the file:

          <label htmlFor="icon-button-file">
                <Input id="icon-button-file" type="file" />
                <Button
                    variant="contained"
                    component="span"
                    sx={{mt:0.2}}>
                    Escolher
                </Button>
                
            </label>
                <TextField
                size = "small"
                disabled
                fullWidth
                />

I am trying to get the path of the selected file and paste on the text field.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source