[TYPO3-dam] Improving file type indexing with mime_content_type()

René Fritz r.fritz at colorcube.de
Sat Oct 8 02:48:20 CEST 2005


> 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.
>
> What do you think? Should I open a feature request in the bugtracker?

Hi Steffen

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.
Also the mime type dectection of apache/php is often less good than the one 
implemented by the dam extension.

Until there are better solutions I won't change it. So you have to provide 
code instead of writing a feature request :-)

greetings
René


-- 
COLORCUBE
digital media lab

www.colorcube.de



More information about the TYPO3-project-dam mailing list