note 20891 rejected from features.file-upload by sander
| From: | sander@php.net | Date: | Sat, 20 Apr 2002 17:18:22 +0000 |
| Subject: | note 20891 rejected from features.file-upload by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-29611@lists.php.net to get a copy of this message | ||
In response to the issue about MIME types being reported differently for each browser, this is a
routine I use to overcome this pitfall. While this is certainly not fullproof, neither is using
MIME types to begin with to coordinate data typing if your concerned MIME spoofing. But in closed
systems, which is generally where you do any kind of uploading like this, it works just fine.
if(eregi("jpeg", $uploaded_image_type)){
echo "This image is a JPEG!";
}
Or what have you... Just be sure to verify that the regex you use matches all reported MIME types
by all browsers in question.