Tomcat下的專案訪問本地檔案
阿新 • • 發佈:2018-12-10
在tomcat中 server.xml檔案中
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">下面加入
<Context debug="0" docBase="E:\edu_upload\" path="/file" reloadable="true"/> 這一行
docBase 你本地檔案地址 path 訪問是對映地址
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Context debug="0" docBase="E:\edu_upload\" path="/file" reloadable="true"/>
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
</Host>