I have seen the best solution so far here, and this is the code:
function getMaxUploadSize() { $max_upload = (int)(ini_get('upload_max_filesize')); $max_post = (int)(ini_get('post_max_size')); $memory_limit = (int)(ini_get('memory_limit')); return min($max_upload, $max_post, $memory_limit); }
Attila fulop
source share