note 107166 deleted from function.image-type-to-mime-type by tularis
| From: | tularis@php.net | Date: | Thu, 12 Jan 2012 11:26:36 +0000 |
| Subject: | note 107166 deleted from function.image-type-to-mime-type by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185603@lists.php.net to get a copy of this message | ||
Note Submitter: thephpguru at hotmail dot com
Reason: useless
----
<?
//For image_type_to_mime_type to work you need to input the getimageinfo array number for the image
type. Example
$img_file = "/home/mydir/my_img.UNKNOWN";
$img_info = getimagesize("$img_file");
header('Content-disposition: filename='.basename("$img_file"));
header("Content-type: " . image_type_to_mime_type($img_info[2]));
header("Content-Length: " . filesize("$img_file"));
readfile("$img_file");
?>