How can I add new mimetypes to Mongrel from within my app, i.e. from an initialization script?
Thank开发者_Python百科s!
Piece of cake. Adding a few lines in an initializer script (e.g. config/initializers/mime_types.rb) was all that was needed:
Mongrel::DirHandler::add_mime_type('.epub', 'application/epub+zip')
Mongrel::DirHandler::add_mime_type('.jad', 'text/vnd.sun.j2me.app-descriptor')
精彩评论