Multipart File Upload using AngularJS and SpringMVC

后端 未结 2 1522

I am new to angularJS and trying to upload a file using angular JS and Spring MVC, but not able to get the required solution and ending up with exceptions in JS Controller.

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 01:55

    update your request mapping with the following code:

     @RequestMapping(value = "/upload-file", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    

    It will remove your multipart exception.

提交回复
热议问题