I've used ini_set('post_max_size',"2M") in my php script to limit uploads file size. it didn't worked (do you know why ? )
So i put these rules on my htaccess file :
php_value post_max_size 2M
php_value upload_max_filesize 2M
So when i upload a file larger than 2M , my php script shows this error :
Warning: POST Content-Length of 15903708 bytes exceeds the limit of 2097152 bytes in Unknown on line 0
How can i handle this error in an appropriate way ? (something like try catch).
Note : I wouldn't like to hide this error.
phpinfo()?