Skip to content

Commit

Permalink
Update UploadController.java
Browse files Browse the repository at this point in the history
Signed-off-by: Eason <[email protected]>
  • Loading branch information
ZhouYixun authored May 14, 2024
1 parent b3d536c commit 762f187
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ public RespModel<String> uploadRecord(@RequestParam(name = "file") MultipartFile
}

String fileName = file.getOriginalFilename();
if (fileName != null) {
fileName = new File(fileName).getName();
String newName = fileName.substring(0, fileName.indexOf(".mp4")) + "-" + index + ".mp4";
File local = new File(uuidFolder.getPath() + File.separator + newName);
}
if (fileName == null) {
return new RespModel(RespEnum.UPLOAD_FAIL);
}
fileName = new File(fileName).getName();
String newName = fileName.substring(0, fileName.indexOf(".mp4")) + "-" + index + ".mp4";
File local = new File(uuidFolder.getPath() + File.separator + newName);
RespModel<String> responseModel;
try {
file.transferTo(local.getAbsoluteFile());
Expand Down

0 comments on commit 762f187

Please sign in to comment.