From d8eae07e6015a58bf9ec03e2f48b97ba2a260b82 Mon Sep 17 00:00:00 2001 From: LiJun <LiJun@192.168.10.30> Date: 星期五, 16 十一月 2018 17:16:00 +0800 Subject: [PATCH] 上传视频后台代码修复 --- gx_tieta/src/com/fgkj/actions/MyFileAction.java | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gx_tieta/src/com/fgkj/actions/MyFileAction.java b/gx_tieta/src/com/fgkj/actions/MyFileAction.java index 8bc9101..2ceea7d 100644 --- a/gx_tieta/src/com/fgkj/actions/MyFileAction.java +++ b/gx_tieta/src/com/fgkj/actions/MyFileAction.java @@ -175,16 +175,24 @@ //涓婁紶鏈烘埧瑙嗛鎺ュ彛 public String uploadStationFile(){ BattInf binf = getGson().fromJson(json, BattInf.class); - String fileRoot = "staionsrc"; + String fileRoot = "stationsrc"; ServiceModel model = new ServiceModel(); boolean isSuccess = false; String loadpath = ActionUtil.getSession().getServletContext().getRealPath("/"); String str = new File(loadpath).getParentFile().getAbsolutePath(); //鑾峰彇鏈嶅姟鍣ㄦ墍鍦ㄧ殑缁濆璺緞 - String root = str+"/"+fileRoot+"/"+binf.getStationId()+"/vide/"; // 涓婁紶璺緞 + String root = str+"/"+fileRoot+"/"+binf.getStationId()+"/video/"; // 涓婁紶璺緞 for(int i=0;i<file.length;i++){ String filePath = root+fileFileName[i]; createFilefolderIFNotExist(filePath); copyFile(file[i], filePath); + isSuccess = true; + } + if(isSuccess){ + model.setCode(1); + model.setMsg("涓婁紶鎴愬姛"); + }else{ + model.setCode(0); + model.setMsg("涓婁紶澶辫触"); } result = tojson(model); return SUCCESS; @@ -258,6 +266,10 @@ + public void setJson(String json) { + this.json = json; + } + public static void main(String[] args) { String filePath = "D:/test/a/a.txt"; ActionUtil.createFileRootIFNotExist(filePath); -- Gitblit v1.9.1