| | |
| | | <artifactId>poi-tl</artifactId> |
| | | <version>1.7.3</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml-schemas</artifactId> |
| | | <version>4.1.2</version> <!-- 与您的POI版本匹配 --> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | |
| | |
| | | documentBytes = outputStream.toByteArray(); |
| | | headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); |
| | | headers.setContentDispositionFormData("attachment", filename.replace(".doc", ".docx")); |
| | | |
| | | } else if (filename.endsWith(".docx") || filename.endsWith(".xlsx")) { |
| | | documentBytes = FileCopyUtils.copyToByteArray(in); |
| | | headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); |