Feature #15790

Use the mime-types gem to get mime type for unknown extension

Added by luigifab ! about 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Files
Target version:2.5.0
Resolution:Fixed

Description

Redmine::MimeType.of('402388.webm')
return nothing

According to lib/redmine/mime_type.rb, it's normal.
But, this mime type (ie, video/webm), like many others, exists, like for examples http://www.freeformatter.com/mime-types-list.html.

Associated revisions

Revision 12483
Added by Jean-Philippe Lang about 4 years ago

Use the mime-types gem for getting mime types from filenames (#15790).

History

#1 Updated by luigifab ! about 4 years ago

Ok, I think this will problem take more than 3 years to resolve it.
Because => #4009 (2009-10-09) => #14206 (2013-06-04) => fixed 2013-07-13.

So, I think that the solution is to run file command to determine file mimetype's:
file --brief --mime-type .../file.webm => video/webm

#2 Updated by Jean-Philippe Lang about 4 years ago

  • Tracker changed from Defect to Feature
  • Subject changed from Mime type of webm/ogv files to Use the mime-types gem to get mime type for unknown extension
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.5.0
  • Resolution set to Fixed

Redmine::MimeType.of now uses the mime-types gem for unknown extensions (r12483). The first type is returned when multiple types match the extension, Redmine::MimeType.of('402388.webm') returns audio/webm.

#3 Updated by luigifab ! over 3 years ago

Wow, express!

Also available in: Atom PDF