spring boot获取表单文件踩的坑


一、问题描述
在做微信网关项目的上后,客户端上传微信素材到网关,网关再将文件传给微信,结果遇到了一个巨坑的问题。
网关后台用的是springboot,客户端上传文件到网关后,网关通过HttpServletRequest获取文件流inputstream,
结果将这个流传给微信端就一直传不过去,报read timeout。

二、问题解决
其实就是下面博客的问题
https://www.cnblogs.com/yskcoder/p/4718198.html

去掉spring boot的 CommonsMultipartResolver
只需在application.properties文件中配置:
spring.http.multipart.enabled=false

发布了38 篇原创文章 · 获赞 6 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/coderlady/article/details/79098431