新增备案信息,禁止上传类型,删除支持密码功能
新增备案信息,禁止上传类型,删除支持密码功能 Signed-off-by: 高雄 <admin@cxcp.com>
This commit is contained in:
parent
75a46a14a8
commit
c7367dfcec
|
@ -1,7 +1,9 @@
|
|||
package cn.keking.utils;
|
||||
|
||||
import cn.keking.config.ConfigConstants;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
|
||||
|
@ -174,4 +176,19 @@ public class KkFileUtils {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断文件是否允许上传
|
||||
*
|
||||
* @param file 文件扩展名
|
||||
* @return 是否允许上传
|
||||
*/
|
||||
public static boolean isAllowedUpload(String file) {
|
||||
String fileType = suffixFromFileName(file);
|
||||
for (String type : ConfigConstants.getprohibit()) {
|
||||
if (type.equals(fileType))
|
||||
return false;
|
||||
}
|
||||
return !ObjectUtils.isEmpty(fileType);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue