Forum: Ruby on Rails content_type from a local file?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Def2c63c6beefdb5ca3e6ec54d04a4a4?d=identicon&s=25 Trevor Turk (trevorturk)
on 2007-07-04 19:05
I'm using a Rake task to add local files into a database designed for
use with attachment_fu.

So, attachment_fu has a "content_type" field, which apparently is
receiving that information from the browser...?

I'm trying to figure out if there is a way to get the content_type of a
file (e.g. 'image/png') that you've already got in your file-system. I
can't find anything about this in the Pickaxe, or by looking at the
attachment_fu plugin.

Any help very much appreciated!
0900e6a4828bd989f96427082c6c74ca?d=identicon&s=25 Mike Garey (random52k)
on 2007-07-05 04:22
(Received via mailing list)
read the following post:

contains information about using the mime-types plugin to determine
content_type outside of the CGI library

Def2c63c6beefdb5ca3e6ec54d04a4a4?d=identicon&s=25 Trevor Turk (trevorturk)
on 2007-07-05 04:26
Terrific. Thanks very much!
This topic is locked and can not be replied to.