note 29432 added to features.file-upload.common-pitfalls

From: Date: Thu, 13 Feb 2003 12:51:13 +0000
Subject: note 29432 added to features.file-upload.common-pitfalls
Groups: php.notes 
Request: Send a blank email to php-notes+get-43879@lists.php.net to get a copy of this message
In older versions of PHP (4.0, 4.1) when you doesn't receive a file you cannot determine exactly what has happend. Here is a part of code with results of my testing (Mozilla 0.9, Explorer 5, Opera 6) if(empty($HTTP_POST_FILES["image"])) { echo ("No file given (Mozilla), file doesn't exist (Konqueror, Mozilla)"); } elseif(empty($HTTP_POST_FILES["image"]["name"]) ) { echo ("No file given (Konqueror, Explorer, Opera), file doesn't exist (Explorer)"); } elseif(empty($HTTP_POST_FILES["image"]["size"]) || $HTTP_POST_FILES["image"]["tmp_name"]=="none") { echo ("File is zero size or too big (or it doesn't exist (Opera))"); } -- http://www.php.net/manual/en/features.file-upload.common-pitfalls.php http://master.php.net/manage/user-notes.php?action=edit+29432 http://master.php.net/manage/user-notes.php?action=delete+29432 http://master.php.net/manage/user-notes.php?action=reject+29432

« previous php.notes (#43879) next »