Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda