On 31/10/13 21:32, Derick Rethans wrote:

Isn't there a reason why you can't use the fileinfo extension/code for
this instead? Hardcoding it seems rather strange?


I looked at the manual and mime_content_type() is deprecated and tells me to use the Fileinfo PECL extension. From which I am led back to the parent section, which is for the built-in Fileinfo extension. Looks like the manual is out-of-date.

Anyhow, looks like finfo_file() works as we'd want, though I feel uneasy about guessing filetypes this way. Perhaps we should have several explicitly specified ones (.txt as text/plain, .html as text/html, etc.), and guess the rest? Especially for ones which it would not correctly guess.

Thanks.
--
Andrea Faulds
http://ajf.me/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to