Commit 67bed719 by guojuxing

上传文件

parent fe424a58
...@@ -80,6 +80,8 @@ public class UploadImgController { ...@@ -80,6 +80,8 @@ public class UploadImgController {
bucketName = BucketNameEnum.REPORT_50000.getName(); bucketName = BucketNameEnum.REPORT_50000.getName();
} else if (isMusic(fileSuffix)) { } else if (isMusic(fileSuffix)) {
bucketName = BucketNameEnum.MUSIC_20000.getName(); bucketName = BucketNameEnum.MUSIC_20000.getName();
} else if (isVedio(fileSuffix)) {
bucketName = BucketNameEnum.VIDEO_40000.getName();
} }
String url = FileOperateUtils.simpleUploadFileFromLocal(targetFile, fieldCode, bucketName); String url = FileOperateUtils.simpleUploadFileFromLocal(targetFile, fieldCode, bucketName);
...@@ -166,4 +168,10 @@ public class UploadImgController { ...@@ -166,4 +168,10 @@ public class UploadImgController {
{"wma", "mpc","ogg", "wav", "mpeg", "mp3"}; {"wma", "mpc","ogg", "wav", "mpeg", "mp3"};
return Arrays.stream(arr).anyMatch(e -> e.equals(fileSuffix)); return Arrays.stream(arr).anyMatch(e -> e.equals(fileSuffix));
} }
public static boolean isVedio(String fileSuffix) throws Exception{
String[] arr =
{"rm", "rmvb","mp4", "wmv", "asf", "asx", "3gp", "mov", "m4v", "avi", "dat", "mkv", "flv", "vob"};
return Arrays.stream(arr).anyMatch(e -> e.equals(fileSuffix));
}
} }
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