Angular Reactive Form File Upload

Discussão em 'Angular' iniciado por shahiedul, Fevereiro 2, 2025.

  1. shahiedul

    shahiedul Guest

    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: "",
    }
    },
    ];

    Continue reading...

Compartilhe esta Página