Commit 814d1100 authored by alex yao's avatar alex yao

fix:uploadDocument上传异常信息修正

parent 60fc45ac
...@@ -81,7 +81,7 @@ public class KnowledgeServiceImpl implements KnowledgeService { ...@@ -81,7 +81,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
long fileSizeInBytes = file.length(); long fileSizeInBytes = file.length();
double fileSizeInMB = (double) fileSizeInBytes / (1024 * 1024); double fileSizeInMB = (double) fileSizeInBytes / (1024 * 1024);
if (fileSizeInMB > 10) { if (fileSizeInMB > 10) {
throw new BusinessException("上传的文件不能超过5M,文件名:" + documentName); throw new BusinessException("上传的文件不能超过10M,文件名:" + documentName);
} }
String fileContent = DocumentLoad.documentToText(file).replaceAll(StringUtils.LF, StringUtils.EMPTY).replaceAll(StringUtils.CR, StringUtils.EMPTY);//文件内容 String fileContent = DocumentLoad.documentToText(file).replaceAll(StringUtils.LF, StringUtils.EMPTY).replaceAll(StringUtils.CR, StringUtils.EMPTY);//文件内容
...@@ -92,7 +92,7 @@ public class KnowledgeServiceImpl implements KnowledgeService { ...@@ -92,7 +92,7 @@ public class KnowledgeServiceImpl implements KnowledgeService {
long charCount = fileContent.length(); long charCount = fileContent.length();
//文件字符数不能超过100w //文件字符数不能超过100w
if (charCount > 100 * 10000) { if (charCount > 100 * 10000) {
throw new BusinessException("文件内容字符数不能超过2w,文件名: " + documentName); throw new BusinessException("文件内容字符数不能超过100w,文件名: " + documentName);
} }
//文件上传 //文件上传
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment