Re: file uploads and sizes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/5/05, Cima <ruel.cima@xxxxxxxxxxxxxxxxx> 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/

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux