为了账号安全,请及时绑定邮箱和手机立即绑定

Antd 的 upload 后台该如何接收?

Antd 的 upload 后台该如何接收?

阿波罗的战车 2019-01-16 23:43:46
@RestController @RequestMapping("/antdUpload") public class AntdUpload { private Logger logger = LoggerFactory.getLogger(AntdUpload.class); @RequestMapping(method = RequestMethod.PUT) public void postExcel(@RequestParam("file")MultipartHttpServletRequest request, HttpServletResponse response) throws IOException { logger.info("antd-upload"); //1. build an iterator Iterator<String> itr = request.getFileNames(); MultipartFile mpf = null; //2. get each file while (itr.hasNext()) { //2.1 get next MultipartFile mpf = request.getFile(itr.next()); InputStream is = mpf.getInputStream(); } } } 结果后台根本收不到请求,不知道是什么问题?
查看完整描述

4 回答

?
海绵宝宝撒

TA贡献1809条经验 获得超8个赞

@RequestMapping(method = RequestMethod.PUT)

uploder发起的是post

查看完整回答
反对 回复 2019-02-12
  • 4 回答
  • 0 关注
  • 2201 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信