AnApprentice
AnApprentice

Reputation: 110960

Rails - Mime not working for paperclip

I'm using Paperclip, when I upload files like PPTX or DOCX, the content_type is showing application/zip which is a incorrect MIME type. Any suggestions for fixing mime types in Rails 3?

Upvotes: 1

Views: 734

Answers (2)

andrea
andrea

Reputation: 3505

try to use paperclip Model with this validation

validates_attachment_content_type :attachment, :content_type => [ 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' ]

append other in you initializer if you need .

Upvotes: 1

Rabbott
Rabbott

Reputation: 4332

Did you add the mime type to /config/initializers/mime_types.rb?

Upvotes: 2

Related Questions