提交 526ed845 authored 作者: zhangshuang's avatar zhangshuang

bug修改,文件大小

上级 77559e40
......@@ -159,8 +159,8 @@ public class FileUploadServiceImpl implements FileUploadService {
fileSave.setFileName(name);//放入文件名称
fileSave.setPath(fileAddress + "/" + name);//文件存储地址
FileOutputStream fileOutputStream = null; //合成后的文件
String savePath = rename(fileAddress + "/" + name,0);
try {
String savePath = rename(fileAddress + "/" + name,0);
fileSave.setRealName(new File(savePath).getName());
fileOutputStream = new FileOutputStream(savePath);
} catch (FileNotFoundException e) {
......@@ -181,7 +181,6 @@ public class FileUploadServiceImpl implements FileUploadService {
//删除md5目录,及临时文件
deleteFile(new File(fileAddress + "/" + md5File));
fileOutputStream.flush();
} catch (Exception e) {
log.error(fileSave.getPath() + "文件保存失败");
e.printStackTrace();
......@@ -194,7 +193,7 @@ public class FileUploadServiceImpl implements FileUploadService {
}
}
//设置文件大小
fileSave.setFileSize(fileSize(fileAddress + "/" + name));
fileSave.setFileSize(fileSize(savePath));
}
}
List<FileSave> fileSaveList = fileSaveDao.saveAll(fileSaves);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论