Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-11575

Improve the accuracy of the attachment content type detection

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.4-milestone-1
    • Fix Version/s: 6.4-milestone-2
    • Component/s: Old Core
    • Labels:
      None
    • Tests:
      Unit
    • Difficulty:
      Easy
    • Documentation:
      N/A
    • Similar issues:

      Description

      We use Tika to detect the attachment content type but we rely only on the attachment file name. This means that if you upload a text file named "foo" (no extension) and call:

      $doc.getAttachment('foo').mimeType
      

      you will get "application/octet-stream". We can improve the accuracy by using the attachment content when the file name extension is unknown.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mflorea Marius Dumitru Florea
                Reporter:
                mflorea Marius Dumitru Florea
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: