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

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