|
|
|
@ -112,11 +112,11 @@ public class uploadController {
|
|
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
|
|
String fileType = fileName.substring(fileName.lastIndexOf("."));
|
|
|
|
|
// 文件类型判断
|
|
|
|
|
if (StringUtils.isBlank(fileType) || (!fileType.equals(".jpg") && !fileType.equals(".png") && !fileType.equals(".doc") &&!fileType.equals(".pdf"))) {
|
|
|
|
|
if (StringUtils.isBlank(fileType) || (!fileType.equals(".jpg") && !fileType.equals(".png") && !fileType.equals(".doc") && !fileType.equals(".pdf"))) {
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件只能是 jpg,png,doc,pdf 格式");
|
|
|
|
|
}
|
|
|
|
|
String newName = UUID.randomUUID() + fileType;//生成新文件名
|
|
|
|
|
String savePath = "d:/1s/udiwms/register/file/" + type;
|
|
|
|
|
String savePath = filePath + "/register/" + type;
|
|
|
|
|
|
|
|
|
|
File file1 = new File(savePath);
|
|
|
|
|
if (!file1.exists()) {// 判断目录是否存在
|
|
|
|
|