|
@ -65,8 +65,8 @@ public class FileUploadController extends BaseController {
|
|
|
fileName = mf.getOriginalFilename();
|
|
|
String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
|
|
|
// 重命名文件
|
|
|
firstPhoto=photo.substring(0,photo.lastIndexOf("."))+"_small."+fileExt;
|
|
|
File uploadFile = new File(firstPhoto);
|
|
|
firstPhoto=photo.substring(0, photo.lastIndexOf("."))+"_small."+fileExt;
|
|
|
File uploadFile = new File(SystemConf.getInstance().getImagePath() + File.separator+firstPhoto);
|
|
|
// 拷贝文件流到指定文件路径
|
|
|
FileCopyUtils.copy(mf.getBytes(), uploadFile);
|
|
|
// 生成缩略图
|
|
@ -75,7 +75,7 @@ public class FileUploadController extends BaseController {
|
|
|
//images.add(uploadFile);
|
|
|
//tempPaths.add(datePath + newFileName);
|
|
|
}
|
|
|
String urls = firstPhoto;
|
|
|
String urls = SystemConf.getInstance().getImageServer()+firstPhoto;
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("status", 200);
|
|
|
json.put("msg", "上传成功");
|