note 52388 modified in function.mime-content-type by aidan
| From: | aidan@php.net | Date: | Fri, 13 May 2005 03:06:23 +0000 |
| Subject: | note 52388 modified in function.mime-content-type by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-89359@lists.php.net to get a copy of this message | ||
if you arern't allowed to use mime_content_type, you can use this function
<?php
function mime_content_type_($filename)
{
$mime = array(
'.3dmf' => 'x-world/x-3dmf',
'.a' => 'application/octet-stream',
'.aab' => 'application/x-authorware-bin',
//[... i have to cut, the text is too long :/ ..]
'.xwd' => 'image/x-xwd',
'.xyz' => 'chemical/x-pdb',
'.z' => 'application/x-compressed',
'.zip' => 'application/x-zip-compressed',
'.zoo' => 'application/octet-stream',
'.zsh' => 'text/x-script.zsh',
);
return $mime[strrchr($filename, '.')];
}
?>
--was--
if you arern't allowed to use mime_content_type, you can use this function
function mime_content_type_($filename)
{
$mime = array(
'.3dmf' => 'x-world/x-3dmf',
'.a' => 'application/octet-stream',
'.aab' => 'application/x-authorware-bin',
[... i have to cut, the text is too long :/ ..]
'.xwd' => 'image/x-xwd',
'.xyz' => 'chemical/x-pdb',
'.z' => 'application/x-compressed',
'.zip' => 'application/x-zip-compressed',
'.zoo' => 'application/octet-stream',
'.zsh' => 'text/x-script.zsh',
);
return $mime[strrchr($filename, '.')];
}
http://php.net/manual/en/function.mime-content-type.php