乱码问题,急!!
用超链接下载文件,在Tomcat4.1下运行时,显示的文件名是乱码,而在JBuilder中运行时是好的,JBuilder中的Tomcat是4.0的,我其中使用的代码如下.
<%@ page import="java.io.*" %><%
response.setHeader("Content-disposition","attachment; filename=test.doc");
FileInputStream fis=new FileInputStream("/usr/temp/test.doc");
OutputStream os=response.getOutputStream();
int byteRead;
while(-1 != (byteRead = fis.read())) {
os.write(byteRead);
}
os.close();
if (fis != null)
fis.close();
%>
不知道为什么?