Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-14916

CSV files cannot be uploaded when MS Excel is installed

    XMLWordPrintable

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.

       

      Attachments

        Activity

          People

            aschrijvers Ard Schrijvers
            jhoffman Jeroen Hoffman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: