file_upload_max_size

Versions
4.7 – 7
file_upload_max_size()

Determine the maximum file upload size by querying the PHP settings.

Return value

A file size limit in bytes based on the PHP upload_max_filesize and post_max_size

Related topics

▾ 3 functions call file_upload_max_size()

blogapi_admin_settings in modules/blogapi/blogapi.module
upload_admin_settings in modules/upload/upload.module
Menu callback for the upload settings form.
upload_admin_settings_validate in modules/upload/upload.module
Form API callback to validate the upload settings form.

Code

includes/file.inc, line 722

<?php
function file_upload_max_size() {
  static $max_size = -1;

  if ($max_size < 0) {
    $upload_max = parse_size(ini_get('upload_max_filesize'));
    $post_max = parse_size(ini_get('post_max_size'));
    $max_size = ($upload_max < $post_max) ? $upload_max : $post_max;
  }
  return $max_size;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.