Я следовал инструкциям из https://github.com/carrierwaveuploader/carrierwave#setting-the-content-typecarrierwave не спасает CONTENT_TYPE на Uploader
так что я получил:
require 'carrierwave/processing/mime_types'
class AssetFileUploader < CarrierWave::Uploader::Base
include CarrierWave::MimeTypes
process :set_content_type
...
, но после того, как файл загрузите content_type не обновляется.
я модель AssetInfo с загрузчика AssetFileUploader установлен на
:file attribute
class AssetInfo < ActiveRecord::Base
mount_uploader :file, AssetFileUploader
...
В PARAMS содержат:
... "file"=># @headers="Content-Disposition: form-data; name=\"asset[asset_info_attributes][file]\"; filename=\"img.jpg\"\r\nContent-Type: image/jpeg\r\n"> ...
После загрузки файла я пытаюсь в консоли:
AssetInfo .last.file.file => < CarrierWave :: SanitizedFile: 0x34b1c @ original_filename = n иль @ content_type = ноль @file = "/ главная/Reea/проекты/рубин/learning_cms/государственные/загрузки/asset_info/файл/20/IMG.jpg">
AssetInfo.last.file.file.content_type = > ноль
после обновления приложения для работы с Amazon S3, сохраняется тип контента –