Spring Boot + Angular file upload unable to upload same file twice

后端 未结 2 2116
隐瞒了意图╮
隐瞒了意图╮ 2021-01-07 12:55

Error under Network in chrome

{ timeStamp: ......, status: 400
  error: \'Bad Request\',
  message: \'Required request part \'file\' is not present\'
  path:         


        
2条回答
  •  余生分开走
    2021-01-07 13:16

    Param annotation in your controller looks for a field called file.

    Change selectFile to file will solve the problem.

    formData.append("file", this.data);
    

    Parameter name matters in this, it has to be same in both Java & Angular

提交回复
热议问题