process :set_content_type => 'image/jpeg'
Hi, I will programming an uploader for mp3- and ogg-files for a little project. In other projects I used paperclip but I will carrierwave give a try.Creating an Uploader was very easy. Nice.But the content_type is empty. When I uploaded any kind of file, I see the right content_type in the upload, but when I try to use the content_type, its empty.Also the original_filename, but I only need the content_type for html5 audio type.--- !ruby/object:CarrierWave::SanitizedFile file: .../public/uploads/audio/audio/19/test.ogg original_filename: content_type:I have the 'mime-types' gem installed an my uploader looks like this:# encoding: utf-8
require 'carrierwave/processing/mime_types'
class AudioUploader < CarrierWave::Uploader::Base
include CarrierWave::MimeTypes
process :set_content_type
storage :file
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
endDo I need anything else?--
You received this message because you are subscribed to the Google Groups "carrierwave" group.
To view this discussion on the web visit https://groups.google.com/d/msg/carrierwave/-/DfIC_aV8sN0J.
To post to this group, send email to carri...@googlegroups.com.
To unsubscribe from this group, send email to carrierwave...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/carrierwave?hl=en.
dB. | Moscow - Geneva - Seattle - New York
dblock.org - @dblockdotorg