我无法通过AJAX从我的网络客户端上传文件到我的服务器.我在客户端使用以下jQuery库来进行文件上传:https://github.com/hayageek/jquery-upload-file
In the server-side, I'm using Spring Framework and I have followed the following Spring Tutorial to build my Service: https://spring.io/guides/gs/uploading-files/
At first, my server method looked like this (file was defined as @RequestParam):
@RequestMapping(value="/upload", method=RequestMethod.POST)
public @ResponseBody String handleFileUpload(@RequestParam("file") MultipartFile file){
//functionality here
}
Run Code Online (Sandbox Code Playgroud)
but every time I submitted the Upload form I got a Bad Request message from the Server, and my handleFileUpload() method was never called.
After that, …