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
- Run Confluence version prior to 5.7 (e.g. 5.6.3)
- Create a new page and click Link > Attachments, then insert a PDF file (e.g: with the name "Test.pdf")
- Save the page
- Go to Tools >> Attachments, then click 'Properties' link on the "Test.pdf"
- Modify 'New Content Type' from application/pdf to pdf, and Save
- Upgrade Confluence to 5.7
- In that same page, click "Test.pdf"
- 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
Run the following SQL query: