/**
* 단순 파일 업로드.
*
* @param boardVO
* @param board
* @param sessionVO
* @param model
* @return
* @throws Exception
*/
@RequestMapping("/cop/bbs/insertSummberNoteFile.do")
public void insertSummberNoteFile(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr,
@ModelAttribute("board") Board board, BindingResult bindingResult, SessionStatus status, ModelMap model, HttpServletRequest request,HttpServletResponse response) throws Exception {
LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
JSONArray reportJsonArray = new JSONArray();
if (isAuthenticated) {
List<FileVO> result = null;
String atchFileId = "";
final Map<String, MultipartFile> files = multiRequest.getFileMap();
if (!files.isEmpty()) {
result = fileUtil.parseFileInf(files, "BBS_", 0, "", "");
atchFileId = fileMngService.insertFileInfs(result);
JSONObject obj = new JSONObject();
System.out.println(">>>>> atchFileId : " +atchFileId);
obj.put("atchFileId", atchFileId);
reportJsonArray.add(obj);
}
JSONObject obj = new JSONObject();
reportJsonArray.add(obj);
response.setCharacterEncoding("utf-8");
response.getWriter().println(request.getParameter("callback") + "(" + reportJsonArray+ ")");
response.getWriter().close();
}
}