@ShrineDesignsJul 02.2005 — #you can make one easily[code=php]function mimetype($filename) { $info = pathinfo($filename);
switch(strtolower($info['extension'])) { case 'jpg': return 'image/jpeg'; case 'gif': return 'image/gif'; case 'png': return 'image/png'; case 'zip': return 'application/zip'; case 'gz': return 'application/gzip'; case 'txt': return 'text/plain'; // etc. default: return 'application/octet-stream'; } }[/code]
@bokehauthorJul 02.2005 — #This is what I have so far and it does weed out fake files, but I want to add a few more extensions like .MOV and .MPG: [code=php] if(!function_exists('mime_content_type')){ function mime_content_type($file){ @$size = GetImageSize($file); if ($size[mime]){ return($size[mime]); } return('application/octet-stream'); } }