新增 支持压缩包密码 修复LINUX下中文乱码 解压支持文件目录
新增 支持压缩包密码 修复LINUX下中文乱码 解压支持文件目录 Signed-off-by: 高雄 <admin@cxcp.com>
This commit is contained in:
parent
83d04ca45d
commit
1e771ed649
|
@ -27,6 +27,8 @@ import org.springframework.util.StringUtils;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
|
@ -273,6 +275,14 @@ public class FileHandlerService {
|
|||
FileType type;
|
||||
String fileName;
|
||||
String fullFileName = WebUtils.getUrlParameterReg(url, "fullfilename");
|
||||
String urlStrr = null;
|
||||
URL urll;
|
||||
try {
|
||||
urll = new URL(url);
|
||||
urlStrr = URLDecoder.decode(urll.getPath(), "UTF-8");
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
if (StringUtils.hasText(fullFileName)) {
|
||||
fileName = fullFileName;
|
||||
type = FileType.typeFromFileName(fullFileName);
|
||||
|
@ -283,8 +293,10 @@ public class FileHandlerService {
|
|||
suffix = WebUtils.suffixFromUrl(url);
|
||||
}
|
||||
if (url.contains("?fileKey=")) {
|
||||
fileName=urlStrr;
|
||||
attribute.setSkipDownLoad(true);
|
||||
}
|
||||
// System.out.println(fileName);
|
||||
url = WebUtils.encodeUrlFileName(url);
|
||||
fileName = KkFileUtils.htmlEscape(fileName); //文件名处理
|
||||
attribute.setType(type);
|
||||
|
|
Loading…
Reference in New Issue