|
@@ -90,6 +90,7 @@ public class CommonController {
|
|
bizPath = "";
|
|
bizPath = "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //本地
|
|
if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){
|
|
if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){
|
|
//update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传
|
|
//update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传
|
|
savePath = this.uploadLocal(file,bizPath);
|
|
savePath = this.uploadLocal(file,bizPath);
|
|
@@ -105,6 +106,8 @@ public class CommonController {
|
|
savePath = this.uploadLocal(file,bizPath);
|
|
savePath = this.uploadLocal(file,bizPath);
|
|
}
|
|
}
|
|
*/
|
|
*/
|
|
|
|
+ log.info("本地路径:{}",savePath);
|
|
|
|
+ log.info("上传路径:{}",bizPath);
|
|
}else{
|
|
}else{
|
|
//update-begin-author:taoyan date:20200814 for:文件上传改造
|
|
//update-begin-author:taoyan date:20200814 for:文件上传改造
|
|
savePath = CommonUtils.upload(file, bizPath, uploadType);
|
|
savePath = CommonUtils.upload(file, bizPath, uploadType);
|
|
@@ -145,8 +148,17 @@ public class CommonController {
|
|
fileName = orgName+ "_" + System.currentTimeMillis();
|
|
fileName = orgName+ "_" + System.currentTimeMillis();
|
|
}
|
|
}
|
|
String savePath = file.getPath() + File.separator + fileName;
|
|
String savePath = file.getPath() + File.separator + fileName;
|
|
|
|
+ log.info("最终上传路径:{}",savePath);
|
|
File savefile = new File(savePath);
|
|
File savefile = new File(savePath);
|
|
FileCopyUtils.copy(mf.getBytes(), savefile);
|
|
FileCopyUtils.copy(mf.getBytes(), savefile);
|
|
|
|
+ try {
|
|
|
|
+ if (System.getProperty("os.name").toLowerCase().contains("linux")) {
|
|
|
|
+ Runtime.getRuntime().exec(new String[]{"chmod", "644", file.getPath()});
|
|
|
|
+ }
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ log.info("上传完成:{}",savefile.getName());
|
|
String dbpath = null;
|
|
String dbpath = null;
|
|
if(oConvertUtils.isNotEmpty(bizPath)){
|
|
if(oConvertUtils.isNotEmpty(bizPath)){
|
|
dbpath = bizPath + File.separator + fileName;
|
|
dbpath = bizPath + File.separator + fileName;
|
|
@@ -286,7 +298,7 @@ public class CommonController {
|
|
if (imgPath.endsWith(",")) {
|
|
if (imgPath.endsWith(",")) {
|
|
imgPath = imgPath.substring(0, imgPath.length() - 1);
|
|
imgPath = imgPath.substring(0, imgPath.length() - 1);
|
|
}
|
|
}
|
|
- String filePath = "D:/images" + File.separator + imgPath;
|
|
|
|
|
|
+ String filePath = uploadpath + File.separator + imgPath;
|
|
File file = new File(filePath);
|
|
File file = new File(filePath);
|
|
if(!file.exists()){
|
|
if(!file.exists()){
|
|
response.setStatus(404);
|
|
response.setStatus(404);
|