Skip to content

Commit

Permalink
Merge pull request #435 from smaranchand/main
Browse files Browse the repository at this point in the history
Fixing LFI
  • Loading branch information
ZhouYixun authored Apr 30, 2024
2 parents 5a76b53 + 8682058 commit b3d536c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@ public RespModel<String> uploadRecord(@RequestParam(name = "file") MultipartFile
if (!uuidFolder.exists()) {
uuidFolder.mkdirs();
}

String fileName = file.getOriginalFilename();
String newName = fileName.substring(0, fileName.indexOf(".mp4")) + "-" + index + ".mp4";
File local = new File(uuidFolder.getPath() + File.separator + newName);
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);
}
RespModel<String> responseModel;
try {
file.transferTo(local.getAbsoluteFile());
Expand Down

0 comments on commit b3d536c

Please sign in to comment.