|
@@ -18,7 +18,7 @@ public class FileUtil {
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
try {
|
|
|
// 路径
|
|
|
- String path = filePath +format +fileName;
|
|
|
+ String path = String.format("%s%s_%s", filePath, format, fileName);
|
|
|
File dest = new File(path).getCanonicalFile();
|
|
|
// 检测是否存在目录
|
|
|
if (!dest.getParentFile().exists()) {
|
|
@@ -36,7 +36,7 @@ public class FileUtil {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- public static void del(String filePath){
|
|
|
+ public static void del(String filePath) {
|
|
|
if (filePath != null && filePath.length() > 0) {
|
|
|
File file = new File(filePath);
|
|
|
if (file.exists()) {
|