@RequestMapping("/uploadFile") public void fileUpload(HttpServletRequest request) throws IllegalStateException, IOException { MultipartHttpServletRequest multipartRequest = WebUtils.getNativeRequest(request, MultipartHttpServletRequest.class); MultipartFile file = multipartRequest.getFile("file"); System.out.println(file); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(file.getInputStream())); String lineTxt; while ((lineTxt=bufferedReader.readLine())!=null){ System.out.println(lineTxt); }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)