组件ImageUpload支持多图同时选择上传

This commit is contained in:
RuoYi
2022-02-25 09:08:56 +08:00
parent bb65cd1976
commit e62e8e372c
4 changed files with 81 additions and 12 deletions

View File

@ -256,4 +256,22 @@ public class FileUtils
}
return strFileExtendName;
}
/**
* 获取名称
*
* @param fileName 路径名称
* @return 没有文件路径的名称
*/
public static String getName(String fileName)
{
if (fileName == null)
{
return null;
}
int lastUnixPos = fileName.lastIndexOf('/');
int lastWindowsPos = fileName.lastIndexOf('\\');
int index = Math.max(lastUnixPos, lastWindowsPos);
return fileName.substring(index + 1);
}
}