$userfile=$_FILES['userfile']['tmp_name'];
$userfile_error=$_FILES['userfile']['error'];
if ($userfile_error > 0) 
{echo 'Problem: ';
switch($userfile_error) 
{case 1: echo 'File exceeded upload maximum filesize'; break;
case 2: echo 'File exceeded maximum file size'; break;
case 3: echo 'File only partially uploaded'; break;
case 4: echo 'No file uploaded'; break;
}exit;}

You can use a switch format like I have done previously shown above.
Each file error is mentioned in a different case.
-- 
Ashwin Purohit

On Fri, 18 Jun 2004 10:50:04 -0700, Pablo Gosse <[EMAIL PROTECTED]> wrote:
> 
> Hi folks.  I'm just tweaking the file manager portion of my CMS, and am
> wondering if there is any way I can identify the size of an uploaded
> file which exceeded the upload_max_filesize?  I'd like to be able to
> tell the user the size of the file they tried to upload, in addition to
> telling them the allowable maximum size.
> 
> It would seem logical to me that I would not be able to do this, since
> if the file exceeds the limit set by upload_max_filesize then the upload
> should not continue past that point.
> 
> Is this an accurate assumption?
> 
> Cheers and TIA.
> 
> Pablo

-- 
Ashwin Purohit

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to