Sfoglia il codice sorgente

修复:压缩包中文件名有空格异常

陈精华 5 anni fa
parent
commit
03cc185085

+ 2 - 0
jodconverter-web/src/main/java/cn/keking/utils/DownloadUtils.java

@@ -46,7 +46,9 @@ public class DownloadUtils {
             urlAddress = replacePlusMark(urlAddress);
             urlAddress = encodeUrlParam(urlAddress);
             // 因为tomcat不能处理'+'号,所以讲'+'号替换成'%20%'
+            // 也不能处理空格
             urlAddress = urlAddress.replaceAll("\\+", "%20");
+            urlAddress = urlAddress.replaceAll(" ", "%20");
             url = new URL(urlAddress);
         } catch (MalformedURLException e) {
             e.printStackTrace();