Struts2获取下载文件大小
<result name="success" type="stream">
<param name="contentType">video/x-msvideo</param>
<param name="inputName">targetFile</param>
<param name="contentDisposition">
attachment;filename="${contentDisposition}"
</param>
<!-- 设置缓冲大小为2M -->
<param name="bufferSize">2097152</param>
<param name="contentLength">${contentLength}</param>
</result>
File f = new File(ServletActionContext.getRequest().getRealPath("upload/tdm")+"/"+this.tdm.getTdmFile());
this.contentLength = f.length()+"";
f = null;
文章来源: blog.csdn.net,作者:fengda2870,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/fengda2870/article/details/4756429
- 点赞
- 收藏
- 关注作者
评论(0)