note 20891 added to features.file-upload

From: Date: Sat, 20 Apr 2002 17:15:35 +0000
Subject: note 20891 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-29609@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. -- http://www.php.net/manual/en/features.file-upload.php http://master.php.net/manage/user-notes.php?action=edit+20891 http://master.php.net/manage/user-notes.php?action=delete+20891 http://master.php.net/manage/user-notes.php?action=reject+20891

« previous php.notes (#29609) next »