急死了~实现下载的问题
实现一个简单的下载,但现在他报错,是因为rar文件名是中文的关系吗,我要是想下载中文名的文件应该怎末做~~请各位多多请教~~在这先谢谢了~~
<a href= "${pageContext.request.contextPath}/aaa/书.rar " target= "_blank "> 这是一个录音软件点击请下载 <a/>
下面是爆错原因
HTTP Status 404 - /xx/aaa/%E4%B8%AD%E6%96%87.rar
--------------------------------------------
type Status report
message /xx/aaa/%E4%B8%AD%E6%96%87.rar
description The requested resource (/xx/aaa/%E4%B8%AD%E6%96%87.rar) is not available.
--------------------------------------------
Apache Tomcat/5.0.27
------解决方案--------------------将启动tomcat进程的用户的编码设置为zh_CN.GB18030,这样可以保证Tomcat服务器正确访问文件系统的中文路径的文件
修改Tomcat配置,指定请求解码字符集(URIEncoding= "UTF-8 "),那么,IE如果用UTF-8发送URL请求的话是可以正确访问到中文路径的内容的;
<Connector port= "8080 " maxHttpHeaderSize= "8192 "
maxThreads= "150 " minSpareThreads= "25 " maxSpareThreads= "75 "
enableLookups= "false " redirectPort= "8443 " acceptCount= "100 "
connectionTimeout= "20000 " disableUploadTimeout= "true " URIEncoding= "utf-8 " />