add a MIME type

39 views
Skip to first unread message

John Joseph Bachir

unread,
Feb 15, 2012, 11:24:07 PM2/15/12
to Paperclip Plugin
How can I add a MIME type for paperclip to use when saving foo_content_type to the db and when uploading to S3?

The below initializer does the job for intercepting the File#content_type provided by Paperclip::Upfile, but uploading epubs still results in them being saved in the db and on S3 as application/octet-stream.

How can I fix this?

Thanks,
John



MIME::Types.add MIME::Type.from_hash('Content-Type' => 'application/epub+zip',
                                     'Extensions' => ['epub'])

MIME::Types.add MIME::Type.from_hash('Content-Type' => 'application/x-mobipocket-ebook',
                                     'Extensions' => ['mobi'])

Reply all
Reply to author
Forward
0 new messages