On Sunday, September 26, 2004, at 12:43 PM, Austin Ziegler wrote: > On Mon, 27 Sep 2004 00:34:04 +0900, Patrick May <patrick / hexane.org> > wrote: >> Austin, >> >> This stuff might be useful. This was part of a wiki migration >> script. >> I modified it so you wouldn't have to install narf to use it, but >> you'll need to find a replacement for Web::Mime::get_mime_type in >> FileParam#to_multipart. Or you could hard code the mime-type. > > Thank you. What does Web::Mime::get_mime_type do? Perhaps you > could/should be using my centralised database in MIME::Types -- I'm > planning at some point on extending that in two ways. First, I plan on > using the freedesktop.org shared mime database as an option, and > second I plan on implementing libmmagic in pure Ruby (so you don't > have to trust the extension of the file if you don't choose to do so). Web::Mime is a class in narf that gets mime types by filename extension. It parses a copy of Apache's mime.types file. It's not an exciting class; you should be able to replace that call with anything that returns the appropriate mime type. At the moment, I'm managing my own dependencies to keep the installation of narf as simple as possible. I know that's a bit anti-social, but it makes it easier for me to support narf. Cheers, Patrick