Details
-
Bug
-
Status: Closed
-
Top
-
Resolution: Invalid
-
14.7.0
-
None
-
None
-
Flagged
-
Quasar
Description
Since 14.7.0, CMS-14833, there's a validation check between browser-sent mime type and Tika determined mime type.
In case MS Excel has been installed, the browser sends "application/vnd.ms-excel" as mime type, because of this Windows Registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.csv\Content Type = "application/vnd.ms-excel"
In our code, in org.hippoecm.frontend.plugins.yui.upload.validation.MimeTypeValidator#validate(), there is a comparison for browser-sent vs. Tika determined mime types, and "text/csv"
is not in the structure "application/vnd.ms-excel < application/x-tika-msoffice < application/octet-stream" that Tika checks against in the MediaTypeRegistry.getDefaultRegistry().isInstanceOf calls.
In above set-up, UI denies to upload a simple .csv file and there's a back end logging
[INFO] [talledLocalContainer] 20.12.2021 14:21:29 WARN http-nio-8080-exec-2 [AjaxFileUploadBehavior.setResponse:178] file test.csv contains errors: The file 'test.csv' content does not match with the content MIME type: text/csv
Perhaps there are more problems with MS Office types.