Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda