Method: RedactorRails::UploaderBase::InstanceMethods#extract_content_type

Defined in:
lib/redactor_rails/uploader_base.rb

#extract_content_typeObject



39
40
41
42
43
44
45
46
47
# File 'lib/redactor_rails/uploader_base.rb', line 39

def extract_content_type
  if file.content_type == 'application/octet-stream' || file.content_type.blank?
    content_type = MIME::Types.type_for(original_filename).first
  else
    content_type = file.content_type
  end

  model.data_content_type = content_type.to_s
end