开发者

Adding new mimetypes to mongrel from within an initializer script

开发者 https://www.devze.com 2023-01-31 18:59 出处:网络
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/initiali

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')
0

精彩评论

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

关注公众号