springboot项目向服务器获取静态文件

转:https://blog.csdn.net/Thinkingcao/article/details/86613066

Springboot项目

  文件上传到服务器(例如linux上后,如何在让前端通过链接直接访问到该文件)

在springboot的配置文件application.yml上配置

spring:
  mvc:
   static-path-pattern: /images/**
  resources:
   static-locations: file:C:/workspace/file/

启动项目即可通过ip+port+images+文件名访问

猜你喜欢

转载自www.cnblogs.com/yongan140621/p/11040123.html