Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
How to disallow users to upload non-PDF files using Vue?

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:

enter image description here

How can I make sure that the users uploads only files in PDF format?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!