-
Bug
-
Resolution: Not a bug
-
Low
-
None
-
5.7
-
None
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"
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';
@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.