Ovid has asked for the wisdom of the Perl Monks concerning the following question:
Using CGI.pm, I could try this:
However, browsers like to play "MIMEtype roulette", so this is not an optimal solution.$type = $query->uploadInfo($filename)->{'Content-Type'};
I've also found File::MMagic, but I have no idea how reliable this is. Has anyone used it before? If so, what are your impressions?
What I have works so far (we're only using jpegs, so that makes it easier), but once I let users at it, I need this to be as accurate as possible.
Any suggestions, or am I taking an entirely wrong approach to this?
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just go the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Opinions on determining mime type
by lhoward (Vicar) on Sep 21, 2000 at 03:56 UTC | |
|
Re: Opinions on determining mime type
by Fastolfe (Vicar) on Sep 21, 2000 at 17:42 UTC | |
|
(Ovid - update) Re: Opinions on determining mime type
by Ovid (Cardinal) on Sep 21, 2000 at 01:45 UTC | |
|
RE: Opinions on determining mime type
by geektron (Curate) on Sep 21, 2000 at 02:06 UTC | |
|
Re: Opinions on determining mime type
by ncw (Friar) on Sep 21, 2000 at 01:46 UTC |