Commit defef165 by 江和松

APP段上传附件代码修改

parent ee49ba16
......@@ -16,9 +16,11 @@ import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import net.sf.json.JSONObject;
import org.springframework.web.multipart.support.DefaultMultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
......@@ -30,7 +32,7 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping({"/upload/file"})
public class FileUploadController {
/**
* 更具docId上传文件
*
......@@ -44,7 +46,11 @@ public class FileUploadController {
JSONObject upload = new JSONObject();
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
upload = UploadUtils.upload((CommonsMultipartFile)file);
Iterator multiFileIterator = ((DefaultMultipartHttpServletRequest) request).getMultiFileMap().get("uploadFile").iterator();
while(multiFileIterator.hasNext()) {
CommonsMultipartFile multipartFile = (CommonsMultipartFile)multiFileIterator.next();
upload = UploadUtils.upload(multipartFile);
}
}else {
upload = UploadUtils.uploadFile(request);
}
......@@ -58,7 +64,7 @@ public class FileUploadController {
return resultMap;
}
}
/**
* @param content
* @return
......@@ -75,5 +81,5 @@ public class FileUploadController {
return resultMap;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment