下载
使用手册
aa.html
UploadiFive Test$(function () {
var myDropzone = new Dropzone("div#myId", { url: "http://localhost:8010/thymeleaf/uploadImage"});
myDropzone.on('success', function (files, response) {
//文件上传成功之后的操作
alert(response.newfile);
});
});
java
@Controller
@RequestMapping("/thymeleaf")
public class ThymeleafController {
@RequestMapping("uploadImage")
@ResponseBody
public Map upload(MultipartFile file){
String fileName = file.getOriginalFilename();
System.out.println(fileName);
Map infoMap = new HashMap();
infoMap.put("newfile", "" + fileName);
return infoMap;
}
}