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

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 关注
  • 2248 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号