Просмотр исходного кода

【提交内容】:上传下载,bug修复

wangyj18 лет назад: 9
Родитель
Сommit
a79b9459e5
1 измененных файлов с 5 добавлено и 4 удалено
  1. 5 4
      display-server/src/com/ai/server/bean/UploadDownloadBean.java

+ 5 - 4
display-server/src/com/ai/server/bean/UploadDownloadBean.java

@ -56,9 +56,10 @@ public class UploadDownloadBean extends DisplayBean {
56 56
		try {
57 57
			/* 多个上传文件 */
58 58
			List<FileItem> fileList = upload.parseRequest(request);
59
			if(fileList.size() != filePaths.length){
60
				MobileUtility.error("提交的文件数量和保存的文件列表数量不一致,请检查参数!");
61
			}
59
			// 多文件上传判断 还有些问题,未调通
60
//			if(fileList.size() != filePaths.length){
61
//				MobileUtility.error("提交的文件数量和保存的文件列表数量不一致,请检查参数!");
62
//			}
62 63
			for (int i = 0; i < fileList.size(); i++) {
63 64
				FileItem item = fileList.get(i);
64 65
				String name = item.getFieldName();// 获取表单的属性名
@ -71,7 +72,7 @@ public class UploadDownloadBean extends DisplayBean {
71 72
					request.setAttribute(name, value); // 保存文件名
72 73
					//文件在server上保存地址
73 74
					filePath = ApplicationPath.getFilePath(request) + filePaths[i];
74
					File dir = new File(filePaths[i]).getParentFile();
75
					File dir = new File(filePath).getParentFile();
75 76
					if(! dir.exists() && ! dir.mkdirs()){
76 77
						MobileUtility.error("创建上传文件夹失败!");
77 78
					}