http://blog.csdn.net/yin_jw/article/details/43524659
1. Configure in the Tomcat directory
Put the file directly in the Tomcat6/webapps/root directory,
Then visit the URL: Http://192.168.2.31:8080/download.zip can be downloaded.
2. Configure in other directories
If you don't want to put it under Webapps/root, configure the directory you want to download:
[HTML]View Plaincopy
- <? XML version= "1.0" encoding="UTF-8"?>
- <Context path="/download" docbase="d://download" crosscontext="true" >
- </Context>
- Modify the Tomcat configuration file, file directory \conf\web.xml, to change the red false to true.
[HTML]View Plaincopy
- <servlet>
- <servlet-name>default</servlet-name>
- <servlet-class>org.apache.catalina.servlets.defaultservlet</servlet-class >
- <init-param>
- <param-name>debug</param-name>
- <param-value>0</param-value>
- </init-param>
- <init-param>
- <param-name>listings</param-name>
- <param-value>false</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
Restart Tomcat, Access Http://127.0.0.1:8080/download
3. Legacy issues:
In the use of the process seems to be equipped with some format file download is not stable, the download to half of the phenomenon of interruption.
"Go" Tomcat build file server