This commit is contained in:
parent
373b1e509f
commit
7a81753b3d
|
@ -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));
|
||||||
|
|
Loading…
Reference in New Issue