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

272
Vistas
JavaScript FormData() access file body

I have an HTML form with a file upload input. The form data is stored in a FormData() object so I can send it to the server using AJAX.

What I'm trying to do is access the FormData() values so I can modify the file contents that appear in the request. I have been monitoring the requests in Web Developer Tools -> Network.

If I'm uploading a .txt file or image, I want to be able to read its content, modify it and append it to the FormData().

My code so far is able to show the File object but I have no clue how to access the contents.

for( var pair of myFormData.entries() ){

   /* pair[1] is the file object inside the FormData */
   console.log(pair[0], pair[1]);

}

Thank you.

about 4 years ago · Santiago Trujillo
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