Skip to content

Commit 2431078

Browse files
authored
[CCAP-639] Handling another Tika file issue (#646)
1 parent 7cbdd2d commit 2431078

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/formflow/library/file/FileValidationService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,13 @@ public FileValidationService(
8282
.sorted()
8383
.collect(Collectors.toList());
8484

85-
if (ACCEPTED_FILE_EXTS.contains(".doc")) {
86-
// It's possible that Tika will return this for an MS Office document instead of the
85+
if (ACCEPTED_FILE_EXTS.contains(".doc") || ACCEPTED_FILE_EXTS.contains(".docx")) {
86+
// It's possible that Tika will return this for an Office document instead of the
8787
// correct Mime Type, if the version of Office is old or Tika can't quite determine if
8888
// it's a Word vs Excel document (for example)
8989
// This little workaround will insert Tika's returned value in those cases of ambiguity.
9090
acceptedMimeTypes.add(new MimeType("application", "x-tika-msoffice"));
91+
acceptedMimeTypes.add(new MimeType("application", "x-tika-ooxml"));
9192
}
9293

9394
ACCEPTED_MIME_TYPES = acceptedMimeTypes;

0 commit comments

Comments
 (0)