struts2下载问题

无论怎么认知,用迅雷下和IE8下下载 都是出现*.action文件,不能正常出现下载文件名和类型。
[code]public InputStream getDownLoadFile() throws FileNotFoundException {
this.setFile();
String realPath = ServletActionContext.getRequest().getRealPath(
"/upload");
InputStream inputStream = new FileInputStream(realPath+"/"+this.file);
return inputStream;

}[/code]

在downloadAction中 代码如上
在下载端头文件如下:
Server Apache-Coyote/1.1
Content-Disposition attachment;file="2.jpg"
Content-Type application/octet-stream;charset=ISO8859-1
Transfer-Encoding chunked
Date Sun, 09 May 2010 11:33:59 GMT

struts.xml配置文件如下:
[code="java"]

downLoadFile
application/octet-stream;charset=ISO8859-1
attachment;file="${file}"

[/code]

能正常下载,为什么会这样呢?求朋友们给个答案。

首先,想把字符集去掉

然后,你的Aciton中有file属性吗?

看我的博客吧:

[url]http://xiaolongfeixiang.iteye.com/blog/662450[/url]

有了 ,你再看看。呵呵

你的MimeType配置错误了。

请参考 Tomcat/conf/weg.xml中的内容

doc的应该是application/msword 或者 application/vnd.ms-word