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 18 days 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 Katsuya HIDAKA 15 days 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 4 days ago
- Related to Feature #44385: Replace MiniMime with Marcel in Redmine::MimeType for consistent MIME type lookup added