如何在Spring Boot中将图像上传到classpath目录?

时间:2019-07-18 08:36:22

标签: image spring-boot upload

嗨〜我是初级程序员..我尝试直接将图像上传到classpath! 但这是错误代码!我想在application.yaml中设置图像目录地址。帮帮我:)

## application.yaml

mybatis:
 mapper-locations: classpath:/sqlmap/sqlmapper_*.xml
file:
 upload-dir: **classpath:/static/img** ## error!
 upload-dir: C:\Users\img ## success!

1 个答案:

答案 0 :(得分:0)

尝试一下:

spring:
  http:
    multipart:
      location: d:/root