[TYPO3-core] RFC: add a mehtod to determine the MIME Type of a file to t3lib_div

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Wed Feb 21 13:59:20 CET 2007


Ingo Renner schrieb:
> Hi *,
> 
> This is a patch request.
> 
> Branches: trunk
> 
> Problem:
> 
> A method to determine the MIME type of a file is needed from time to  
> time, but is not available where one would expect it.
> 
> Solution:
> 
> Add a method getMimeType() to t3lib_div. The current alternative code  
> for PHP's native function is taken from t3lib_htmlmail.
> 
> Notes:
> 
> There are several methods in TYPO3 to do this already they all could  be 
> consolidated to the new method.
> As we set the PHP version requirement to 4.3.0+ we could just use  this 
> method as a pure wrapper for PHP's function mime_content_type().

mime_content_type() is deprecated and does not work like our funtion. The 
former does an extention-to-type mapping, the latter retrieves the mime 
type from the content header and is therefore working only for http 
resources. The extention-to-type mapping takes place in 
t3lib_htmlmail->getExtendedURL.

Masi


More information about the TYPO3-team-core mailing list