note 61333 added to function.move-uploaded-file

From: Date: Tue, 31 Jan 2006 19:10:06 +0000
Subject: note 61333 added to function.move-uploaded-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-102782@lists.php.net to get a copy of this message
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"; } ---- Server IP: 64.246.30.37 Probable Submitter: 200.118.48.128 ---- Manual Page -- http://www.php.net/manual/en/function.move-uploaded-file.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61333 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61333&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61333&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61333&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61333&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61333&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61333&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61333&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61333&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102782) next »