Paperclip validates_attachment_content_type for mp3 triggered when attaching mp3
- by zoltarSpeaks
Hey everyone,
Struggling to workout when i add the following validtion to my Voice model using paperclip, it is being triggered when i try and upload an mp3:
class Voice < ActiveRecord::Base
has_attached_file :clip
validates_attachment_presence :clip
validates_attachment_content_type :clip, :content_type => [ 'application/mp3', 'application/x-mp3', 'audio/mpeg', 'audio/mp3' ],
:message => 'file must be of filetype .mp3'
validates_attachment_size :clip, :less_than => 10.megabytes
validates_presence_of :title
end
I have tried a number of different mp3 files but none of them seem to upload because the validation is failing.