通过流来读取,例如:
TextFileForm fileForm = (TextFileForm) form; FormFile formFile = fileForm.getTxtFile(); if (formFile.getFileData().length == 0) { response.setCharacterEncoding("gb2312"); response.getWriter().write(""); } InputStream in = formFile.getInputStream(); WordExtractor extractor = new WordExtractor(); String str = extractor.extractText(in);这段代码就是负责读取word的
温馨提示:答案为网友推荐,仅供参考