0%

下载文件提示 Cannotcall sendError() after the response has been committed

下载文件提示 \Cannotcall sendError() after the response has been committed**

出现这个错误,应该是多次response导致的,可以这么理解,将文件写入response后就关闭了socket,这个时候再次发送response给客户端就会出现这个问题。

1
2
3
4
还加return AjaxVoResult 会发生Cannot call sendError() after the response has been committed 错误,因为download方法里面已经将要返回的数据写入response里面了
// 所以return null;
// return new AjaxVoResult(StatusCode.SUCCESS.getCode(), StatusCode.SUCCESS.getMessage(), "下载成功");
return null;
Donate comment here.

欢迎关注我的其它发布渠道