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

104
Views
¿Cómo puedo cargar 2 archivos desde axios?

Recientemente, necesito tener un script para usar axios post 2 archivos juntos en mi matraz.
Quiero usar append para crear un archivo [] en mi vue.

 let formData = new FormData(); formData.append('files',this.file1); formData.append('files',this.file2); axios({ method: "post", data:formData, headers: { 'Content-Type': "multipart/form-data", }, url: "http://127.0.0.1:5000/getPic", responseType: "arraybuffer", })

Y también quiero usar request.files para recibir los 2 archivos en mi matraz:

 files=[] for i in range(len(request.files)): {files.append(request.files[i])} file_len =len(files) if(file_len == 0): return "未上传文件" if(file_len == 1): return "只上传了一个文件" for i in file_len: print (files[i].filename) file1 = Image.open(files[0])

Pero cuando uso cargar los 2 archivos, me dice algo mal:

 werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand. KeyError: 0

¿Alguien sabe lo que está mal?

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!