java 上传 MultipartFile attach 获取不到信息 用的是 dropzone.js
伊谢尔伦
伊谢尔伦 2017-04-17 11:53:56
0
0
582

java 上传 MultipartFile attach 获取不到信息

attach怎么为空

@RequestMapping(value="/upload", method=RequestMethod.POST, produces="application/json;charset=UTF-8") @ResponseBody public String upload(Model model, @RequestParam("attach") MultipartFile attach, HttpServletRequest req, HttpSession session) throws IOException { System.out.println("Name:"+attach.getName()); System.out.println("ContentType:"+attach.getContentType()); System.out.println("OriginalFilename:"+attach.getOriginalFilename()); System.out.println("Size:"+attach.getSize()); System.out.println("Bytes:"+attach.getBytes()); System.out.println("Class:"+attach.getClass()); System.out.println("InputStream:"+attach.getInputStream()); return null; }

前面全部是空。空子真异常

搞定,应该这么写:@RequestParam("file") MultipartFile file

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all (0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!