开发者

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 suggestion开发者_开发百科s for fixing mime types in Rails 3?


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


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 .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜