提交 f2723ed4 authored 作者: zhangshuang's avatar zhangshuang

文件大小

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