Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-36666

Unable to Preview PDF Attachment Link Due to Wrong MEDIA_TYPE After Upgrade

XMLWordPrintable

      When an attachment type is "pdf" instead of "application/pdf" added to Confluence page as Link > Attachments, upgrading the instance to version 5.7 will not allow that Link to be previewed with the File Preview feature.

      Steps to replicate

      1. Run Confluence version prior to 5.7 (e.g. 5.6.3)
      2. Create a new page and click Link > Attachments, then insert a PDF file (e.g: with the name "Test.pdf")
      3. Save the page
      4. Go to Tools >> Attachments, then click 'Properties' link on the "Test.pdf"
      5. Modify 'New Content Type' from application/pdf to pdf, and Save
      6. Upgrade Confluence to 5.7
      7. In that same page, click "Test.pdf"

      Observation

      • The "Test.pdf" link is not displayed in File preview
      • Inserting new Link > Attachments (e.g: "Test_2.pdf") in that page will allow the link "Test_2.pdf" to be displayed in File preview
      • Prior to version 5.7, the CONTENTTYPE is stored in ATTACHMENTS table. In version 5.7, this information is migrated to CONTENTPROPERTIES table

      Workaround
      Run the following SQL query:

      update contentproperties set STRINGVAL = 'application/pdf' where PROPERTYNAME = 'MEDIA_TYPE' AND STRINGVAL = 'pdf';
      

      KB Article

              Unassigned Unassigned
              prompas Patrice Rompas (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: