|
@@ -26,6 +26,7 @@ import org.springframework.web.servlet.HandlerMapping;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
+import java.net.URLDecoder;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.nio.file.Files;
|
|
|
import java.nio.file.Path;
|
|
@@ -297,7 +298,7 @@ public class SysFileController {
|
|
|
String bestMatchingPattern = request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE).toString();
|
|
|
// 提取与模式相匹配的部分(不包括通配符)
|
|
|
String extractedPath = antPathMatcher.extractPathWithinPattern(bestMatchingPattern, path);
|
|
|
- String uploadFile = spaceFileRecordService.uploadAbsolutePath(extractedPath);
|
|
|
+ String uploadFile = spaceFileRecordService.uploadAbsolutePath(URLDecoder.decode(extractedPath, "UTF-8"));
|
|
|
// 构建文件的完整路径
|
|
|
Path filePath = Paths.get(uploadFile);
|
|
|
Resource resource = new FileSystemResource(filePath.toFile());
|
|
@@ -341,7 +342,7 @@ public class SysFileController {
|
|
|
String bestMatchingPattern = request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE).toString();
|
|
|
// 提取与模式相匹配的部分(不包括通配符)
|
|
|
String extractedPath = antPathMatcher.extractPathWithinPattern(bestMatchingPattern, path);
|
|
|
- String uploadFile = spaceFileRecordService.uploadAbsolutePath(extractedPath);
|
|
|
+ String uploadFile = spaceFileRecordService.uploadAbsolutePath(URLDecoder.decode(extractedPath, "UTF-8"));
|
|
|
// 构建文件的完整路径
|
|
|
Path filePath = Paths.get(uploadFile);
|
|
|
Resource resource = new FileSystemResource(filePath.toFile());
|