代码如下:文件存储在腾讯云上。
@GetMapping("/test")
public void test(@RequestParam(value = "path") String path, HttpServletResponse response) {
try(InputStream inputStream = fileService.download(path)) {
IOUtils.copy(inputStream, response.getOutputStream());
} catch (IOException e) {
log.error("异常", e);
}
}