开发者

Adding new mimetypes to mongrel from within an initializer script

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜