I am trying to get plupload to work with spring mvc. I know I am returning null and that will not give me any success or error messages on plupload.
Questions I have at this point:
1) What is best practice for saving files coming from an HTML5 file uploader. Since the file is Multipart I am not sure how to save it properly?
2) Eventually I plan to pass a folder path to the controller, what would be best practice to handle paths, but at the same time protect against misuse?
@Controller
@RequestMapping(value = "/upload")
public class UploadController {
@RequestMapping(method = RequestMethod.POST)
public String uploadItem(@RequestBody MultipartFile file,
@RequestParam String name,
@RequestParam(required = false, defaultValue = "-1") int chunks,
@RequestParam(required = false, defaultValue = "-1") int chunk) {
System.err.println("Original Name: " + file.getOriginalFilename());
return null;
}
}