This commit is contained in:
zjt 2024-09-13 23:44:13 +08:00
parent 7a81753b3d
commit 28320537e4
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ public class LoginController {
public String uploadcommit(MultipartFile file) { public String uploadcommit(MultipartFile file) {
//保存文件 //保存文件
File file1 = new File("D:/javaee/untitled/data"); File file1 = new File("D:/javaee/untitled/data");
//随机数不重复永远 //随机数不重复 永远
String filename = UUID.randomUUID().toString() +file.getOriginalFilename(); String filename = UUID.randomUUID().toString() +file.getOriginalFilename();
try { try {
file.transferTo(new File(file1, filename)); file.transferTo(new File(file1, filename));