1736gerr

可以这样,文件上传到本地目录例如E\:/tomcat/upload/ 
web 访问这样: http://localhost:8080/project/upload/aa.jpg 
在服务器中配置映射地址, 以tomcat为例子 
在conf/server.xml中配置 

<Host name="localhost"  appBase="webapps" 
            unpackWARs="true" autoDeploy="true"> 

<Context path="/upload" docBase="E:/tomcat/upload/" debug="0" reloadable="true">   
        </Context> 
</Host> 

这样/upload  就映射到了文件存储的目录 

就可以通过名字才访问资源

分类:

技术点:

相关文章:

  • 2021-07-22
  • 2021-09-22
  • 2021-11-30
  • 2021-11-30
  • 2022-12-23
  • 2021-11-30
猜你喜欢
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2021-07-03
  • 2022-02-18
相关资源
相似解决方案