Re: file uploads and sizes

From: Date: Fri, 06 May 2005 03:54:13 +0000
Subject: Re: file uploads and sizes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-214582@lists.php.net to get a copy of this message
On 5/5/05, Cima <ruel.cima@facinf.uho.edu.cu> wrote: > i have the following code that works except when the file i'm trying to > upload excedes the upload_max _filesize and post_max_size defined in the > php.ini file. > what happens when the file is smaller than the max sizes mentioned > previously, the if (isset .....) part of the code is executed yet when the > file exceeds both max sizes, i just get a blank page. > what id like is to be able to give the user a message saying the file wasnt > uploaded because the file was too big.so, how do i verify the size of the > file the user is trying to upload? ive already tried > $_FILES['archivo']['size'], but that doesnt work if the variable isnt set, > which aparently happens when the file isnt uploaded because of the > post_max_size. > > any help will be greatly appreciated!! You need to evaluate each of the possible return values for $_FILES[ 'archivo' ][ 'error' ] http://php.net/manual/en/features.file-upload.errors.php -- Greg Donald Zend Certified Engineer http://destiney.com/

« previous php.general (#214582) next »