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

158
Views
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
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!