Commit 0d0b9906 authored by liaoanyuan's avatar liaoanyuan

文件上传文件名称修改

parent 3181f651
......@@ -71,7 +71,7 @@ public class FileUploadController {
folder.mkdirs();
}
String oldName = file.getOriginalFilename();
String newName = UUID.randomUUID().toString() + oldName.substring(oldName.lastIndexOf("."));
String newName = UUID.randomUUID().toString().substring(4,9) + oldName;
try {
file.transferTo(new File(folder, newName));
String url = "/upload_flowChart/" + newName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment