[nycphp-talk] Determining mime type of data not a file
Chris Merlo
chris at theyellowbox.com
Wed Jan 25 10:46:58 EST 2006
On 1/25/06, Scott Mattocks <scott at crisscott.com> wrote:
> The cache class is an in house class that I can't really mess with. It
> holds a lot of other types of data besides images and we want it to stay
> as generic as possible.
Make a subclass!
Unless I am confused, the mime type isn't a property of the file it is a
> property of the data. So I don't see why all of the mime type functions
> and classes that I have found only work on files.
Probably because when all our favorite languages were created, 99% of data
was in files, because people had less RAM.
There is a program that comes with Linux called "file" which determines the
type of data in a file, regardless of file name, extension, etc. If you can
dig through that source code, maybe it'll help in your quest.
-c
--
chris at theyellowbox.com
http://www.theyellowbox.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20060125/3c322207/attachment.html>
More information about the talk
mailing list