class ElFinderS3::MimeType

Represents default MIME types recognizer.

Constants

TYPES

File extension to mime type mapping.

Public Class Methods

for(pathname) click to toggle source

Gets MIME type fort specified path. @param [::Pathname, String] pathname Path to recognize its MIME type. @return [String] MIME type if known; ‘unknown/unknown’ otherwise.

# File lib/el_finder_s3/mime_type.rb, line 76
def self.for(pathname)
  pathname = ::Pathname.new(pathname) if pathname.is_a?(String)
  TYPES[pathname.extname.downcase[1..-1]] || 'application/octet-stream'
end