You are here

function imce_validate_filesize in IMCE 6

Same name and namespace in other branches
  1. 6.2 inc/imce.page.inc \imce_validate_filesize()
  2. 7 inc/imce.page.inc \imce_validate_filesize()

Validate filesize for maximum allowed file size.

1 call to imce_validate_filesize()
imce_validate_all in inc/page.inc
Validate uploaded file.

File

inc/page.inc, line 590

Code

function imce_validate_filesize($file, $maxsize = 0) {
  $errors = array();
  if ($maxsize && $file->filesize > $maxsize) {
    $errors[] = t('The file is %filesize exceeding the maximum file size of %maxsize.', array(
      '%filesize' => format_size($file->filesize),
      '%maxsize' => format_size($maxsize),
    ));
  }
  return $errors;
}