Re: MIME type

From: Date: Wed, 27 Jun 2001 07:45:32 +0000
Subject: Re: MIME type
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-55333@lists.php.net to get a copy of this message
> is there a function to get the mime of a given file? if so what? Probably not... For starters, PHP doesn't really know much about mime-types, because they are defined by Apache*, not PHP. Secondly, mime-types *can* change on the fly in different directories based on .htaccess files, if your httpd.conf has .htaccess turned on. ISPs turn it on for their customers to have whatever weird-o file types they want. Dedicated boxes turn it off and set them all in httpd.conf for a big performance gain. Checking for, and reading, an .htaccess file in every directory above the current one for every single file served is pretty expensive. So any such function would either return suspect results (ie, subject to change by .htaccess) or would require the URI of the file, not just the name, and be rather slow. Post why you think you need this function, and maybe somebody will have a suggestion for how to work without it. * If you are working under Windows, I have no idea how they decide what the mime-type of a file is, and I don't really want to know... -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#55333) next »