@GetMapping("/Download/wpqr/{type}/{fileName}")
public ResponseEntity<Resource> wpqrDownloadFile(@PathVariable("type") String type, @PathVariable("fileName") String fileName) throws DataException, IOException {
String filePath = getFilePath(type.toLowerCase());
Path path = Paths.get(filePath, fileName);
Resource resource = new InputStreamResource(Files.newInputStream(path));
return ResponseEntity.ok()
.contentType(MediaType.parseMediaType("application/octet-stream"))
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\"")
.body(resource);
}
01-16
2228

08-29
1176

04-05
8908

01-12
1216
