I'm using Bootstrap-Vue and Vue2. I would like to use the Form File Input to allow users to upload the files. But the format of the files should be PDF only. So I used accept="application/pdf":
<b-form-file
v-model="fileLoc"
browse-text="choose"
accept="application/pdf"
/>
But when browsing, I can still choose "All" and choose non PDF file:
How can I make sure that the users uploads only files in PDF format?
Actually, the answer is in the link you provided :-)
"Note: Not all browsers support or respect the accept attribute on file inputs."
If you want to make sure that the user uploaded a pdf file, I suggest you to write a function for that (and please make also a server validation since the user could have switched the extension of a file to pdf).