deason 2 years ago
parent
commit
ca55d4325c

+ 1 - 1
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/util/HttpClientUtil.java

@@ -162,7 +162,7 @@ public class HttpClientUtil {
 			response = httpclient.execute(get);
 			InputStream in = response.getEntity().getContent();
 
-			byte[] byteArray = IOUtil.toLimitedByteArray(in, 1048576);
+			byte[] byteArray = IOUtil.toLimitedByteArray(in, maxByteSize);
 			return byteArray;
 		} catch (Exception e) {
 			throw new RuntimeException(e);

+ 1 - 1
examcloud-commons/src/main/java/cn/com/qmth/examcloud/commons/util/IOUtil.java

@@ -88,7 +88,7 @@ public class IOUtil {
 				totalSize += n;
 
 				if (maxByteSize < totalSize) {
-					throw new RuntimeException("input stream exceed the limit.");
+					throw new RuntimeException("文件大小超过" + (maxByteSize / 1024) + "KB限制");
 				}
 			}
 			return out.toByteArray();