From: Eero Saynatkari Date: 2006-08-12T02:56:57+09:00 Subject: Re: Getting a files mime-type Daniel Greig wrote: > Hi, > > Can anyone tell me if there is a simple way to get the mime-type of a > file? > (I've seen the Mime::Type library, but haven't figured out how to use > it). > I'm trying to check the type before processing a bunch of files on disk > (and ignoring files that I'm not interested in. Is there a better way > than using the file extension? On *x systems, you can use the 'file' utility. $ file filename.ext > thanks, > Dan -- Posted via http://www.ruby-forum.com/.