Created
December 22, 2015 16:19
-
-
Save maxkostinevich/c82d3450dfb864557abb to your computer and use it in GitHub Desktop.
PHP: Get Upload Filesize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Return allowed upload filesize in MB. | |
function get_upload_max_filesize(){ | |
$upload_max_filesize = (int)(ini_get('upload_max_filesize')); | |
$post_max_size = (int)(ini_get('post_max_size')); | |
$memory_limit = (int)(ini_get('memory_limit')); | |
$allowed_size = min($upload_max_filesize, $post_max_size, $memory_limit); | |
return $allowed_size; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment