3

If you upload a file via a normal form, then it works. If you load the file / files with ajaxupload nothing works.

Error:

org.springframework.web.multipart.MultipartException: The current request is not a multipart request

Code:

@RequestMapping (value = "/ upload", method = RequestMethod.POST)
public void upload (@ RequestParam MultipartFile file, 
HttpServletRequest request, HttpServletResponse response)

Purpose - Multibooting files with ajax, can anyone have a working example for the Spring.

I have a separate servlet that receives HttpServletRequest and parses everything is fine. On the client side ajaxupload.

If you try a simple Spring MVC transfer request in this class, he refuses to work, arguing that the request is not multipart. Spring is obtained as a sawing the original request?

Javier C.
  • 7,859
  • 5
  • 41
  • 53
rdm
  • 330
  • 1
  • 4
  • 18

1 Answers1

0

Please change fileupload.js , search and comment out the line which has "application/octet-stream"

and add following line : xhr.setRequestHeader("Content-Type", "multipart/form-data");

NoodleX
  • 709
  • 1
  • 7
  • 21