| | |
| | | @ApiImplicitParam(name = "file", value = "文件夹", required = true, paramType = "query", dataType = "String", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping(value = "/uploadLocal", headers = "content-type=multipart/form-data") |
| | | public void uploadLocal(String folder, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | public void uploadLocal(HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | uploadFileLocal(multipartRequest, folder+ "/", response, |
| | | uploadFileLocal(multipartRequest, response, |
| | | systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.IMG_DIR).getCode() , |
| | | systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FILE_DIR).getCode()); |
| | | |
| | | } |
| | | |
| | | public void uploadFileLocal(HttpServletRequest request, String folder, HttpServletResponse response, String rootPath,String dir) throws Exception { |
| | | public void uploadFileLocal(HttpServletRequest request, HttpServletResponse response, String rootPath,String dir) throws Exception { |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("text/html;charset=UTF-8"); |
| | | CommonsMultipartResolver multipartResovler = new CommonsMultipartResolver(); |
| | |
| | | return; |
| | | } |
| | | String nowDate = DateUtil.getNowShortDate(); |
| | | folder += nowDate + "/"; |
| | | String folder = nowDate + "/"; |
| | | String strDirPath = rootPath + folder; |
| | | File dirPath = new File(strDirPath); |
| | | if (!dirPath.exists()) { |