mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-24 11:49:51 +08:00
优化图片和视频的上传文件名去掉扩展名
This commit is contained in:
@@ -60,7 +60,7 @@ public class UploadServiceImpl implements UploadService {
|
||||
}
|
||||
|
||||
// 上传原文件的文件名
|
||||
fileInfo.setOriginalName(filename.replaceAll("." + fileInfo.getExtension(), ""));
|
||||
fileInfo.setOriginalName(filename.replaceAll("(?i)." + fileInfo.getExtension(), ""));
|
||||
// 自定义新的存储文件名
|
||||
fileInfo.setSaveName(HelperUtil.randomString(32) + "." + fileInfo.getExtension());
|
||||
// 生成保存的相对路径
|
||||
|
||||
Reference in New Issue
Block a user