文件下载调整

pro
wj 2 years ago
parent 22cf3f4687
commit 2a3dcb6564

@ -112,7 +112,6 @@ public class IdcController {
response.setContentType("application/force-download"); response.setContentType("application/force-download");
idcService.downloadFile(fileName, response); idcService.downloadFile(fileName, response);
} }
} }
@RequestMapping("/mapi/**") @RequestMapping("/mapi/**")

@ -629,7 +629,8 @@ public class IdcServiceImpl implements IdcService {
public void downloadFile(String fileName, HttpServletResponse response) { public void downloadFile(String fileName, HttpServletResponse response) {
OutputStream os; OutputStream os;
String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : fileName.substring(0, 1).equals("/") ? "" : "/"; String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : fileName.substring(0, 1).equals("/") ? "" : "/";
String sourceFileName = filePath +filePathSlash+imagePath +fileName; // String sourceFileName = filePath +filePathSlash+imagePath +fileName;
String sourceFileName = fileName;
try { try {
if (FileUtils.isFileExist(sourceFileName)) { if (FileUtils.isFileExist(sourceFileName)) {
byte[] bytes = FileUtils.readFileByBytes(sourceFileName); byte[] bytes = FileUtils.readFileByBytes(sourceFileName);

Loading…
Cancel
Save