59392 上传文件的文件名称校验,最多70位。

This commit is contained in:
wangzhijiang
2022-09-09 16:52:15 +08:00
parent e2024da38d
commit bd152116cd
@@ -170,6 +170,13 @@ public class CommonController {
// bizPath = ""; // bizPath = "";
// } // }
} }
if(file.getOriginalFilename().length()>70){
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
throw new JeroBootException("文件名长度不能超过70位,请检查!");
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
throw new JeroBootException("File name length cannot exceed 70 characters, please check!");
}
}
// OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut); // OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut);
OSSFile oSSFile = ossFileService.uploadLocalOfCos(file, bizPath,state,cut); // 切换cos OSSFile oSSFile = ossFileService.uploadLocalOfCos(file, bizPath,state,cut); // 切换cos
if (oConvertUtils.isNotEmpty(oSSFile)) { if (oConvertUtils.isNotEmpty(oSSFile)) {
@@ -186,6 +193,10 @@ public class CommonController {
return result; return result;
} }
public static void main(String[] args) {
}
/** /**
* 查看已上传的文件 * 查看已上传的文件
* @param id * @param id