Bladeren bron

修改文件获取

Yangzw 1 maand geleden
bovenliggende
commit
989d51c1c0

+ 2 - 2
feifan-framework/feifan-common/src/main/java/cn/newfeifan/mall/framework/common/util/servlet/ServletUtils.java

@@ -111,8 +111,8 @@ public class ServletUtils {
             long lpos= flens[1].length()>0?Long.valueOf(flens[1]):sf.length()-1; //表示文件读取文件大小
 
             rinfo.skipLenth=fpos;
-//            rinfo.content_Length=lpos-fpos+1;
-            rinfo.content_Length=sf.length();
+            rinfo.content_Length= lpos > 0? lpos-fpos-1:sf.length()-(fpos > 0?fpos-1:0);
+//            rinfo.content_Length=sf.length();
             rinfo.content_Range=ranplits[0]+" "+fpos+"-"+lpos+"/"+sf.length();
         }
         return rinfo;