修改上传文件大小为0的bug

This commit is contained in:
chenxudong 2025-01-13 14:42:46 +08:00
parent ec75439749
commit 0c8835f2fa
2 changed files with 2 additions and 2 deletions

View File

@ -735,7 +735,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath()); String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath());
FileUtil.writeFromStream(file.getInputStream(), fileDestPath); FileUtil.writeFromStream(file.getInputStream(), fileDestPath);
EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes())); EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes()));
fileSystemService.save(FileUtil.getInputStream(fileDestPath), fileDestPath); // fileSystemService.save(FileUtil.getInputStream(fileDestPath), fileDestPath); // 这里会导致文件大小为0考虑到当前的系统为OS文件系统暂不处理
} }
} catch (Exception e) { } catch (Exception e) {
newEdFileInfo.setParentId(parentId) newEdFileInfo.setParentId(parentId)

View File

@ -234,7 +234,7 @@ public class EdFileRelationServiceImpl extends ServiceImpl<EdFileRelationMapper,
String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath()); String fileDestPath = commonService.getFileSysPath(newEdFileInfo.getFilePath());
FileUtil.writeFromStream(file.getInputStream(), fileDestPath); FileUtil.writeFromStream(file.getInputStream(), fileDestPath);
EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes())); EleCommonUtil.encryptFile(fileDestPath, SecureUtil.aes(FILE_SEC_PASSWD.getBytes()));
fileSystemService.save(FileUtil.getInputStream(fileDestPath), fileDestPath); // fileSystemService.save(FileUtil.getInputStream(fileDestPath), fileDestPath); // 这里会导致文件大小为0考虑到当前的系统为OS文件系统暂不处理
// 创建文件关系 // 创建文件关系
EdFileRelation relation = new EdFileRelation(); EdFileRelation relation = new EdFileRelation();