You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I don't know it is a correct way to fix the issue.
It slightly changes the behavior in guessed_safe_content_type case. (in a case where Marcel can't detect the type from the file content and declared_content_type is nil)
The text was updated successfully, but these errors were encountered:
Some uploaded files have wrong content-type with carrierwave 3.0.3.
With carrierwave 3.0.3:
*.ai
) are identified asapplication/pdf
.*.xlsx
) are identified asapplication/zip
. (Some Excel files are identified correctly)With carrierwave 2.2.4:
*.ai
) are identified asapplication/illustrator
.*.xlsx
) are identified asapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.I know
*.ai
is a PDF with specific metadata and*.xlsx
is a ZIP.But
*.ai
should be downloaded as Adobe Illustrator file.I think this commit cause the issue.
a2ca59c
It may be fixed if replcacing this line
carrierwave/lib/carrierwave/sanitized_file.rb
Line 324 in 8815592
with:
ActiveStorage identifies files in the same way.
https://github.com/rails/rails/blob/b5d63b9b16c6f251eaa08f61086f21ff3ef3292f/activestorage/app/models/active_storage/blob.rb#L353-L355
But I don't know it is a correct way to fix the issue.
It slightly changes the behavior in
guessed_safe_content_type
case. (in a case where Marcel can't detect the type from the file content anddeclared_content_type
is nil)The text was updated successfully, but these errors were encountered: