![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring Boot文件上传
摸鱼码长
懂的越多,不懂的越多
展开
-
springboot 以IO流形式返回给前端
1、Controller@ApiOperation(value = "IO流返回给前端")@GetMapping("fileView")public void fileView(@ApiParam(value = "文件路径", required = true) @RequestParam String fileUrl, HttpServletResponse response) { fileService.fileView(fileUrl, response);}2、Service原创 2021-12-29 11:17:11 · 4178 阅读 · 0 评论 -
SpringBoot 文件(图片示例)上传
SpringBoot 文件上传1、application.yml 配置2、Controller3、Impl1、application.yml 配置spring: mvc: # url访问文件路径 static-path-pattern: /** web: resources: # 用于描述(静态)资源的存放位置 多个路径(逗号隔开)中依次查找是否存在 static-locations: classpath:/ ,file:/ servlet:原创 2021-05-11 14:38:18 · 153 阅读 · 0 评论