Skip to content

Instantly share code, notes, and snippets.

@nunomazer
Created May 8, 2013 23:04
Show Gist options
  • Save nunomazer/5544358 to your computer and use it in GitHub Desktop.
Save nunomazer/5544358 to your computer and use it in GitHub Desktop.
Function to get the max file upload allowed by php.ini configuration
<?php
function getMaxFileUpload() {
$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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment