tags:

views:

40

answers:

2

How can the file upload size allowed by php settings be determined withing a php script?

+4  A: 

Use ini_get to get the current configuration value:

ini_get('upload_max_filesize')
Gumbo
+2  A: 
$max_upload = (int)(ini_get('upload_max_filesize'));
$max_post = (int)(ini_get('post_max_size'));
$memory_limit = (int)(ini_get('memory_limit'));
$upload_mb = min($max_upload, $max_post, $memory_limit);

Source: http://www.kavoir.com/2010/02/php-get-the-file-uploading-limit-max-file-size-allowed-to-upload.html

HyperCas