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

161
Vistas
Folder selector in javascript without post confirmation alert

Actually, I want to select folder path and not upload but I am okay with the solution provided on here.

document.getElementById("folder").addEventListener("change", function(event) {
  var output = document.querySelector("ul");
  var files = event.target.files;

  for (var i=0; i<files.length; i++) {
    var item = document.createElement("li");
    item.innerHTML = files[i].webkitRelativePath;
    output.appendChild(item);
  };
}, false);
label {
  font-weight: bold;
  display: block;
  margin-bottom: 10px;
}

body {
  font-family: sans-serif;
}
<h1>Folder upload</h1>

<label for="folder">Select folder</label>
<input type="file" id="folder" webkitdirectory multiple/>

<h2>Selected Files</h2>

<ul>
</ul>

But I am getting this post conformation message. enter image description here I want to know is there any way (any library anything) to avoid that confirmation box?

about 4 years ago · Juan Pablo Isaza
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