Defect #44335
closedPDF preview of .ai attachments triggers an automatic download
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 usingRedmine::MimeType.of.MiniMimemaps the.aiextension toapplication/pdf, so.aiattachments are rendered using the PDF preview.
Files
Related issues
Updated by Go MAEDA about 1 month ago
- Status changed from New to Confirmed
- Target version set to Candidate for next minor release
Updated by Go MAEDA about 1 month ago
- File 0001-Stop-treating-Adobe-Illustrator-files-as-PDF-files-w.patch 0001-Stop-treating-Adobe-Illustrator-files-as-PDF-files-w.patch added
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?.
Updated by Go MAEDA about 1 month ago
- Target version changed from Candidate for next minor release to 7.0.1
Setting the target version to 7.0.1.
Updated by Katsuya HIDAKA about 1 month ago
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.
Updated by Go MAEDA about 1 month ago
- 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.
Updated by Go MAEDA about 1 month ago
- Status changed from Resolved to Closed
Merged the fix into 7.0-stable branch in r24965.
Updated by Go MAEDA 24 days ago
- Related to Feature #44385: Replace MiniMime with Marcel in Redmine::MimeType for consistent MIME type lookup added