mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-11-24 16:43:13 +08:00
fix encodeUrlFileName method
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<artifactId>kkFileView-parent</artifactId>
|
||||
<groupId>cn.keking</groupId>
|
||||
<version>4.3.0-SNAPSHOT</version>
|
||||
<version>4.3.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>kkFileView</artifactId>
|
||||
@@ -336,7 +336,7 @@
|
||||
<configuration>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/dist-win32.xml</descriptor>
|
||||
<!-- <descriptor>src/main/assembly/dist-win32.xml</descriptor>-->
|
||||
<descriptor>src/main/assembly/dist-linux.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
|
||||
@@ -157,6 +157,9 @@ public class WebUtils {
|
||||
String noQueryUrl = url.substring(0, url.contains("?") ? url.indexOf("?") : url.length());
|
||||
int fileNameStartIndex = noQueryUrl.lastIndexOf('/') + 1;
|
||||
int fileNameEndIndex = noQueryUrl.lastIndexOf('.');
|
||||
if (fileNameEndIndex < fileNameStartIndex) {
|
||||
return url;
|
||||
}
|
||||
try {
|
||||
encodedFileName = URLEncoder.encode(noQueryUrl.substring(fileNameStartIndex, fileNameEndIndex), "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
||||
Reference in New Issue
Block a user