I am trying to make my input type=file to limit the user to only upload pdf.
I looked it up and saw that using accept attribute can help. But it is not working using material UI text fields.
Any solution I can try?
I am trying to make my input type=file to limit the user to only upload pdf.
I looked it up and saw that using accept attribute can help. But it is not working using material UI text fields.
Any solution I can try?
Have you tried this:
<TextField type={"file"} inputProps={{accept:"application/pdf"}}/>
type="file"
–
Apheliotropic inputProps
it works too, but TextField
itself accepts type
prop :) –
Apheliotropic <TextField type={"file"} inputProps={{accept:"application/pdf"}}/>
© 2022 - 2024 — McMap. All rights reserved.
<input type="file" accept=".pdf">
– Crotchety