1 在要处理的action类里加入
2 xml配置
public InputStream getInputStream() throws FileNotFoundException {
return new FileInputStream(fileName);//绝对路径
}
2 xml配置
<result type="stream" name="download">
<param name="contentType">application/octet-stream</param>
<param name="inputName">inputStream</param>
<param name="contentDisposition">attachment;filename="${fileName}"</param>
<param name="bufferSize">4096</param>
</result>