A: First look at the various download methods:
1. A label way: <a target= "_blank" href= "<%=basepath%>html/document/gjb/cybdxz/filename. doc" > file name .doc</a>
2. href mode: function Go (name) {
var url =encodeuricomponent (name);
var Strtouri = "<%=basepath%>html/document/gjb/zyzn/" +url;
location.href= Strtouri;
}
Second: To say the file name of Chinese disorder
It is easy to write Chinese name easily garbled, so it is better not to write Chinese name; The data stock file name can be set two fields; a Chinese name; an English name; display in Chinese name; Download in English name
Solution:encodeuricomponent
The URI is encoded and then encoded into:
http://localhost:8080/ehr/html/document/GJB/ZYZN/201409%e7%94%9f%e8%82%b2%e9%99%a9%e6%8a%a5%e9%94%80%e6%8c%87%e5%8d%97. doc
Such an address would be able to parse the
Note: You must configure Tomcat's Server.xml file here: File location D:\apache-tomcat-7.0.22\conf\server.xml
<connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
Redirectport= "8443" uriencoding= "UTF-8" />//Add uriencoding= "UTF-8 " here
JS download file, download mode <a> and href mode, already Chinese garbled problem