typescript - Angular Reactive Form File Upload - Stack Overflow

admin2025-04-16  6

I have this reactive form which contains an array of Formgroups. And in the field of these formgroups, there are form controls which I intend to have file uploads. Is this possible? I have seen file uploads for reactive forms using the FormData web API but it's mostly for single file uploads. Or is this still possible using FormData web API? Ideally, I would want to send a POST request to the backend in JSON form.

Reactive Form Value:

formGroupArray = [
 {
   "formgroupOne": {
      fileUploadOne: "",
      fileUploadTwo: "",
    }
 },
 {
   "formgroupTwo": {
      fileUploadOne: "",
      fileUploadTwo: "",
    }
 },
];

转载请注明原文地址:http://anycun.com/QandA/1744806604a87881.html