Defect #44335
closed
PDF preview of .ai attachments triggers an automatic download
Added by Katsuya HIDAKA 23 days ago.
Updated 12 days ago.
Description
When an Adobe Illustrator (.ai) file is attached to an issue, opening the attachment details immediately starts a download. Clicking “Open in full view” also starts a download.

The likely cause is the filename-based PDF preview detection:
Attachment#is_pdf? determines the file type from the filename using Redmine::MimeType.of.
MiniMime maps the .ai extension to application/pdf, so .ai attachments are rendered using the PDF preview.
Files
- Status changed from New to Confirmed
- Target version set to Candidate for next minor release
Patch attached.
The issue is fixed by making Redmine::MimeType returns application/illustrator instead of application/pdf for the .ai extension. application/illustrator is not registered with IANA, but it is the type Marcel returns for this extension, and Marcel is already used in Redmine.
Adobe Illustrator files had thumbnails only because Redmine::MimeType reported them as PDF. This patch keeps them working by checking the content type explicitly in Attachment#thumbnailable?.
- Target version changed from Candidate for next minor release to 7.0.1
Setting the target version to 7.0.1.
The patch looks good. I confirmed that it resolves the automatic download issue for .ai attachments, while thumbnails for PDF-compatible .ai files continue to be generated.
- Status changed from Confirmed to Resolved
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the fix in r24946. Thank you for reporting the issue.
- Status changed from Resolved to Closed
Merged the fix into 7.0-stable branch in r24965.
- Related to Feature #44385: Replace MiniMime with Marcel in Redmine::MimeType for consistent MIME type lookup added
Also available in: Atom
PDF