note 61333 deleted from function.move-uploaded-file by cmb
| From: | cmb@php.net | Date: | Mon, 08 Apr 2019 06:40:42 +0000 |
| Subject: | note 61333 deleted from function.move-uploaded-file by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210569@lists.php.net to get a copy of this message | ||
Note Submitter: calamitoso at gmail dot com
----
to separate (for example) images from other file types among the uploaded files you can check the
MIME type also (thus making the file extension check unnecessary)
$temp = strpos($_FILES["pic"]["type"], "image");
if ($rep===FALSE){
//the strpos function will return a boolean "false" ONLY if the needle string is not
found within the haystack
echo "is not an image";
}else{
echo "is an image";
}