note 101479 added to features.file-upload

From: Date: Sun, 19 Dec 2010 15:02:58 +0000
Subject: note 101479 added to features.file-upload
Groups: php.notes 
Request: Send a blank email to php-notes+get-175057@lists.php.net to get a copy of this message
Please be aware that if you do a comparision like ($error == UPLOAD_ERR_OK) you are NOT on the safe side! The official example is fine, because I executes a loop for all $_FILES entries. But if you only expect one file and you check $_FILE['something']['error'] == UPLOAD_ERR_OK directly, it will true even if no file was uploaed, because the constant is zero! So please do $_FILE['something']['error'] === UPLOAD_ERR_OK! ---- Server IP: 69.147.83.197 Probable Submitter: 62.178.15.161 ---- Manual Page -- http://www.php.net/manual/en/features.file-upload.php Edit -- https://master.php.net/note/edit/101479 Del: integrated -- https://master.php.net/note/delete/101479/integrated Del: useless -- https://master.php.net/note/delete/101479/useless Del: bad code -- https://master.php.net/note/delete/101479/bad+code Del: spam -- https://master.php.net/note/delete/101479/spam Del: non-english -- https://master.php.net/note/delete/101479/non-english Del: in docs -- https://master.php.net/note/delete/101479/in+docs Del: other reasons-- https://master.php.net/note/delete/101479 Reject -- https://master.php.net/note/reject/101479 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175057) next »