|
@ -197,7 +197,15 @@ public class FileUploadController extends BaseController {
|
|
|
String pngPath = tempPath.substring(0,tempPath.lastIndexOf("."))+".png";
|
|
|
File tempFile = new File(tempPath);
|
|
|
File pngFile = new File(pngPath);
|
|
|
String times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
|
|
|
long times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
|
|
|
if(times<1000){
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("status", -1);
|
|
|
json.put("success",true);
|
|
|
json.put("msg", "视频录制时间太短!");
|
|
|
json.put("times", times);
|
|
|
return json.toString();
|
|
|
}
|
|
|
ObjectNode imgNode = fastDFSUtil.upload(new FileInputStream(pngPath),"png","");
|
|
|
String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
|
|
|
ObjectNode videoNode = fastDFSUtil.upload(new FileInputStream(tempPath),fileExt,"");
|
|
@ -205,7 +213,7 @@ public class FileUploadController extends BaseController {
|
|
|
+ "/" + imgNode.get("remoteFileName").toString().replaceAll("\"",""));
|
|
|
tempPaths.add(fastUrl + videoNode.get("groupName").toString().replaceAll("\"","")
|
|
|
+ "/" + videoNode.get("remoteFileName").toString().replaceAll("\"",""));
|
|
|
tempPaths.add(times);
|
|
|
tempPaths.add(times+"");
|
|
|
if(tempFile!=null){
|
|
|
tempFile.delete();
|
|
|
}
|
|
@ -325,7 +333,7 @@ public class FileUploadController extends BaseController {
|
|
|
String pngPath = tempPath.substring(0,tempPath.lastIndexOf("."))+".png";
|
|
|
File tempFile = new File(tempPath);
|
|
|
File pngFile = new File(pngPath);
|
|
|
String times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
|
|
|
long times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
|
|
|
ObjectNode imgNode = fastDFSUtil.upload(new FileInputStream(pngPath),"png","");
|
|
|
String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
|
|
|
ObjectNode videoNode = fastDFSUtil.upload(new FileInputStream(tempPath),fileExt,"");
|
|
@ -333,7 +341,7 @@ public class FileUploadController extends BaseController {
|
|
|
+ "/" + imgNode.get("remoteFileName").toString().replaceAll("\"",""));
|
|
|
tempPaths.add(fastUrl + videoNode.get("groupName").toString().replaceAll("\"","")
|
|
|
+ "/" + videoNode.get("remoteFileName").toString().replaceAll("\"",""));
|
|
|
tempPaths.add(times);
|
|
|
tempPaths.add(times+"");
|
|
|
if(tempFile!=null){
|
|
|
tempFile.delete();
|
|
|
}
|