判断上传的文件是否是视频
This commit is contained in:
parent
b828ed3e35
commit
f6c329ab54
@ -336,7 +336,7 @@ public class BusinessDocDetailServiceImpl implements BusinessDocDetailService {
|
||||
String phaseno = fo == null ? "" : fo.getAttribute("PHASENO").getString();
|
||||
|
||||
String othwhere = "";
|
||||
if("BusinessApplyFlow".equals(applyFlow)||"BusinessChangeFlow".equals(applyFlow)||"BusinessCancelFlow".equals(applyFlow)||"BContractApproveFlow".equals(applyFlow)||"BContractCancelFlow".equals(applyFlow)||"".equals(applyFlow)){
|
||||
if("BusinessApplyFlow".equals(applyFlow)||"BusinessChangeFlow".equals(applyFlow)||"BusinessCancelFlow".equals(applyFlow)||"BContractApproveFlow".equals(applyFlow)||"BContractCancelFlow".equals(applyFlow)||"BContractChangeFlow".equals(applyFlow)){
|
||||
othwhere = " and O.ObjectType='BusinessApplyFlow'";
|
||||
}else{
|
||||
othwhere = " and O.ObjectType='"+applyFlow+"'";
|
||||
|
||||
@ -8,6 +8,7 @@ import java.io.InputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -154,6 +155,12 @@ public class BusinessDocUploadServiceImpl implements BusinessDocUploadService {
|
||||
}
|
||||
|
||||
public Object isImage(File file,Object object) throws Exception{
|
||||
String reg = "(mp4|flv|avi|rm|rmvb|wmv)";
|
||||
Pattern p = Pattern.compile(reg);
|
||||
boolean boo = p.matcher(file.getName()).find();
|
||||
if(boo){
|
||||
return "video";
|
||||
}
|
||||
BufferedImage bi = ImageIO.read(file);
|
||||
if(bi==null){
|
||||
return object;
|
||||
|
||||
@ -8,6 +8,7 @@ import java.io.InputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -43,6 +44,11 @@ public class LibraryDocUploadServiceImpl implements LibraryDocUploadService {
|
||||
System.out.println("=======================================");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // ²ÎÊý
|
||||
fileList = (List<Map<String, Object>>) testMap.get("fileList"); // ×ÊÁÏÁбí
|
||||
if(fileList == null || fileList.size()==0){
|
||||
ReturnMapUtil.setReturnMap(null, RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
String applyType = fieldMap.get("applytype") == null ? "" : fieldMap.get(
|
||||
"applytype").toString();
|
||||
|
||||
@ -120,6 +126,12 @@ public class LibraryDocUploadServiceImpl implements LibraryDocUploadService {
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
public Object isImage(File file,Object object) throws Exception{
|
||||
String reg = "(mp4|flv|avi|rm|rmvb|wmv)";
|
||||
Pattern p = Pattern.compile(reg);
|
||||
boolean boo = p.matcher(file.getName()).find();
|
||||
if(boo){
|
||||
return "video";
|
||||
}
|
||||
BufferedImage bi = ImageIO.read(file);
|
||||
if(bi==null){
|
||||
return object;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user