Re: How to get mime type from file name
| From: | raditha dissanayake | Date: | Mon, 16 Aug 2004 00:40:14 +0000 |
| Subject: | Re: How to get mime type from file name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193904@lists.php.net to get a copy of this message | ||
C.F. Scheidecker Antunes wrote:
Hello, Is there any function where I can pass a file name like "file.png" and get return the string of its type 'image/png' ? Basically it is a funcion that takes a file name and returns a string of its mime type. I have used mime_mail to send attachments but the I need when I am attaching the file to know its mime type, for instance a zip file or a jpg or a txt etc. Thanks in advance for the help. there may be better ways but what I usually do is a get a little help from the mime.types file that is part of apache.-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.