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

216
Vistas
How to send array of files as well as json data using axios in React FE and Flask BE?

so as the title explains, I am trying to send both JSON data and an array of files using Axios to my Flask BE server. I am not sure where the problem lies, whether it is in FE or BE, but I cannot seem to send the files. I am trying to send it in a FormData object but if I try to send the array of files together, it shows:

[object File, object File, ...]

When I send them individually, it sends as binary which is what I want. But I cannot send binary data in the array.

If possible, please let me know how I can send it and read it in my Flask server in BE.

EDIT:

let formData = new FormData();
formData.append('data', JSON.stringify(data));

const files = data?.additional_document;

if (Array.isArray(files )) {
 const arrayKey = `additionalFiles`;

 files.forEach(v => {
   formData.append(arrayKey, v);
 });
}

         
dispatch(apiCallToBackEnd(formData, (res) => getPDF(res)));
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