note 29432 deleted from features.file-upload.common-pitfalls by aidan

From: Date: Tue, 12 Oct 2004 07:48:04 +0000
Subject: note 29432 deleted from features.file-upload.common-pitfalls by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-78382@lists.php.net to get a copy of this message
Note Submitter: checat at chat dot ru ---- 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) <?php 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))"); } ?>

« previous php.notes (#78382) next »