How use formData.append for a array in typescript

后端 未结 4 472
别那么骄傲
别那么骄傲 2021-01-18 06:09

Hi i want to send a form to my endpoint Profile, my problem is in the field user:{}, because i can\'t find the way to put my array into this field.

this are the fiel

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 07:04

    I had to add four images to same formdata id. Below is my code

    const files = event.target.files;
      for(var i=0;i< files.length;i++){
        this.formData.append("imgs",files[i]);
      }
    

提交回复
热议问题