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

      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

            [CONFSERVER-36666] Unable to Preview PDF Attachment Link Due to Wrong MEDIA_TYPE After Upgrade

            Dave Drexler added a comment - - edited

            @prompas

            This is apparently (still) an issue with .txt and .sql files. Planning an upgrade from v5.3.x to v5.9.x.

            In v5.3, links to attached text and SQL files open in the user's default application for the file types.

            In v5.9, they're getting the ugly "Can't Preview - you must download" message.

            Dave Drexler added a comment - - edited @prompas This is apparently (still) an issue with .txt and .sql files. Planning an upgrade from v5.3.x to v5.9.x. In v5.3, links to attached text and SQL files open in the user's default application for the file types. In v5.9, they're getting the ugly "Can't Preview - you must download" message.

              Unassigned Unassigned
              prompas Patrice Rompas (Inactive)
              Affected customers:
              0 This affects my team
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: