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

145
Views
How to get files submitted from a form into a local folder using javascript

I want to grab files put into the form into a folder in the same directory all i have is the form and a the javascript for the file to be able to get selected

            <form>
              <div id="filejs" class="file is-info has-name">
                <label class="file-label">
                  <input class="file-input" type="file" name="stuff" />
                  <span class="file-cta">
                    <span class="file-icon">
                      <i class="fas fa-upload"></i>
                    </span>
                    <span class="file-label"> </span>
                  </span>
                  <span class="file-name"> Upload file </span>
                  <input class="button" type="submit" value="Submit input" />
                </label>
              </div>
            </form>
         
    <script>
      const fileInput = document.querySelector("#filejs input[type=file]");
      fileInput.onchange = () => {
        if (fileInput.files.length > 0) {
          const fileName = document.querySelector("#filejs .file-name");
          fileName.textContent = fileInput.files[0].name;
        }
      };
    </script>

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

0

You can not get uploaded files from a form with client-side Javascript. You will require any backend technology for this job. You can use node.js as it is an asynchronous event-driven JavaScript runtime environment. There are many free packages available that can handle form files and form data like multer, formidable, form-data etc.

Also, you can check out the PHP form handling method here.

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!