0.02
No commit activity in last 3 years
No release in over 3 years
get the mimetype of a file directly in Ruby NOTICE: I am So Awesome Man! I'm just forking this to put on gemcutter... the designated maintainer can have the namespace whenever
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies
 Project Readme
MimetypeFu
==========

#
# NOTICE: I am So Awesome Man! I'm just forking this to put on gemcutter... 
# the designated maintainer can have the namespace over there whenever 
# (I want to make a few changes for my convenience too)
#

Some great Rails plugins like attachment_fu use the content type/mime type of a file to validate the instance of an object.
The plugin usually gets the mime type using the CGI request, however, if the file is already in the system, this approach won't work.
Adobe Flash is also known not to send the proper mime type.
As an alternative, I wrote mimetype_fu, a simple plugin which will try to guess the mimetype of a file based on its extension.

Note that mimetype_fu only looks at the extension to define its mime type if you are using Windows!

http://github.com/mattetti/mimetype-fu

Thanks to forestcarlisle for his big report and patch.


Copyright (c) 2008 Matt Aimonetti, released under the MIT license