Uploaded image for project: 'Lucee Development'
  1. LDEV-1549

cffile - mimetype of MS Office files incorrect in 5.2.2.71+

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.2.2.71
    • Fix Version/s: 5.2.7.7
    • Labels:
      None
    • Environment:

      Windows Server 2012
      JDK 8

    • Sprint:
      March 2018

      Description

      Behaviour of <cffile action="upload" ...> appears to have changed in 5.2.2.71 which result in the contentsubtype getting reported incorrectly for all MS Office documents and potentially others.

      Following are the results of some test done with two MS Word 2016 docx files, one with content and the other without. A simple reproduction test is attached.

      On 5.2.1.9

      • Uploading a Word 2016 file with content:
        contentsubtype = vnd.openxmlformats-officedocument.wordprocessingml.document
      • Uploading a Word 2016 file without content
        contentsubtype = vnd.openxmlformats-officedocument.wordprocessingml.document

      On 5.2.2.71 and up

      Uploading a Word 2016 file with content
      contentsubtype = x-tika-ooxml

      Uploading a Word 2016 file without content
      contentsubtype = octet-stream

      Replication:

      Isolated the issue to a simple form post with a cfml page to handle the form submit.

      <!-- index.html -->
      <form id="frm-upload" name="frm-upload" enctype="multipart/form-data" action="index.cfm" method="post">
      	<input type="file" name="myfile" id="myfile"><br>
      	<input type="submit" id="submit">
      </form>
      
      //index.cfm
      <cffile action="upload" filefield="form.myfile" result="fileResult" destination="#GetTempDirectory()#" nameconflict="makeunique">
      <cfdump var="#fileResult#">
      

      Test files (can't attach an empty docx):
      test with content.docx index.cfm index.html

        Attachments

        1. index.cfm
          0.2 kB
        2. index.html
          0.2 kB
        3. result_5.2.2.48-SNAPSHOT.png
          15 kB
        4. result_5.2.7.49-SNAPSHOT.png
          14 kB
        5. test with content.docx
          11 kB
        6. testWithcontent.PNG
          12 kB
        7. testWithoutContent.docx
          10 kB
        8. testWithoutContent.PNG
          12 kB

          Issue links

            Activity

              People

              • Assignee:
                michaeloffner Michael Offner
                Reporter:
                jfrobishow J R
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: