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

846
Views
¿Cómo puedo enviar varios archivos blob como FormData desde Angular al backend (matraz de Python)?

En mi caso, solo obtuve la última foto de los datos del formulario. Quiero todas las fotos para enviar backend.
archivo my.ts.component,

 await Promise.all(blobUrls.map(async (blobUrl) => { const blob = await fetch(blobUrl).then(fetched => fetched.blob()); this.formData = new FormData(); this.formData.append('file', blob); })); const { url } = await this.service.uploadFile(this.clientId, this.formData, uuidv4()) .toPromise().catch(err => { this.cliApiService.handleErrorMessage(err); throw err; });

En servicio.ts,

 uploadFile(client_id: string, formData, filename: string): Observable<any> { const options = this.generateFormOption(true); const queryUri = `${this.apiEndpoint}${this.apiPath}/storage/upload/${client_id}/${filename}`; return this.http.post<any[]>(queryUri, formData, options); }

en matraz,

 storage_image_file_request.add_argument('file', location='files', required=True) class ImageUploadResource(BaseResource): @ns_storage.marshal_with(storage_image_url_message) def post(self, client_id: str, filename: str): args = storage_image_file_request.parse_args() files = args.get('file')

Quiero enviar todos los datos de formulario y también quiero obtener todos los datos de formulario en el matraz. Ahora, solo obtengo una foto, incluso subo dos fotos.

ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Declarando así puede resolver mi problema.

 export class myComponent implements OnInit { formData = new FormData(); await Promise.all(blobUrls.map(async (blobUrl) => { const blob = await fetch(blobUrl).then(fetched => fetched.blob()); this.formData.append('file', blob); })); }
about 4 years ago · Santiago Gelvez Report
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!