正如我正在尝试使用带有postman chrome附加组件的spring boot和webservices.
在邮递员content-type="multipart/form-data"
和我得到以下例外.
HTTP Status 500 - Request processing failed;
nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request;
nested exception is java.io.IOException:
org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found
Run Code Online (Sandbox Code Playgroud)
在Controller中我指定了以下代码
@ResponseBody
@RequestMapping(value = "/file", headers = "Content-Type= multipart/form-data", method = RequestMethod.POST)
public String upload(@RequestParam("name") String name,
@RequestParam(value = "file", required = true) MultipartFile file)
//@RequestParam ()CommonsMultipartFile[] fileUpload
{
// @RequestMapping(value="/newDocument", , method = RequestMethod.POST)
if (!file.isEmpty()) {
try {
byte[] fileContent …
Run Code Online (Sandbox Code Playgroud) java web-services file-upload multifile-uploader spring-boot