note 28311 modified in features.file-upload.errors by sniper

From: Date: Fri, 23 May 2003 00:54:50 +0000
Subject: note 28311 modified in features.file-upload.errors by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48849@lists.php.net to get a copy of this message
[Editor's note: You should use the predefined constants instead] If you want to use a switch to display the error or succes message you can copy and paste this block of code: switch ($_FILES['userfile']['error']){ case 0: echo $_FILES['userfile']['name']."(". $_FILES['userfile']['size']." bytes) was uploaded succesfull."; break; case 1: echo "The uploaded file exceeds the upload_max_filesize directive in php.ini."; break; case 2: echo "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form."; break; case 3: echo "The uploaded file was only partially uploaded."; break; case 4: echo "No file was uploaded."; break; case 5: echo "Uploaded file size 0 bytes"; break; } --was-- If you want to use a switch to display the error or succes message you can copy and paste this block of code: switch ($_FILES['userfile']['error']){ case 0: echo $_FILES['userfile']['name']."(". $_FILES['userfile']['size']." bytes) was uploaded succesfull."; break; case 1: echo "The uploaded file exceeds the upload_max_filesize directive in php.ini."; break; case 2: echo "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form."; break; case 3: echo "The uploaded file was only partially uploaded."; break; case 4: echo "No file was uploaded."; break; case 5: echo "Uploaded file size 0 bytes"; break; } http://www.php.net/manual/en/features.file-upload.errors.php

« previous php.notes (#48849) next »