[TYPO3-dam] Improving file type indexing with mime_content_type()
Steffen Müller
steffen at mail.kommwiss.fu-berlin.de
Sat Oct 8 12:55:21 CEST 2005
On 08.10.2005 02:48 René Fritz wrote:
>>At the moment, DAM uses the filename extension to guess the media type
>>of a file. E.g. document.pdf will be categorized as text/pdf. So far so
>>good.
>>
>>In my eyes it's more clean to check the MIME type of the file with
>>mime_content_type()
>>
>>Using that, even if I rename document.pdf to document.gif it will still
>>be indicated as text/pdf.
>>
>
> I made some test what the best solution is to detect the mime type. The point
> is detecting the file type by it's content (eg. file command on unix) is
> faaaar less good than just using the extension. The indexing process will use
> other detecting mechanisms if there's no extension and works - but not as
> good.
Could you please be more precise, what tests you made and what results
you got.
> Until there are better solutions I won't change it. So you have to provide
> code instead of writing a feature request :-)
I digged a bit in the web and found out, that the php mime modul is
depreciated. There's a new one on pecl:
http://pecl.php.net/package/fileinfo
Did you take this one into account in your tests?
Let's first discuss before writing code.
--
cheers
Steffen
More information about the TYPO3-project-dam
mailing list