You are here

function _ocupload_check_max_filesize in One Click Upload 7

Same name and namespace in other branches
  1. 7.2 ocupload.inc \_ocupload_check_max_filesize()

Element validate callback for the maximum upload size field. Ensure a size that can be parsed by parse_size() has been entered.

1 string reference to '_ocupload_check_max_filesize'
ocupload_form_template in ./ocupload.inc
Form add/edit template

File

./ocupload.inc, line 512
Service functions

Code

function _ocupload_check_max_filesize($element, &$form_state) {
  if (!empty($element['#value']) && !is_numeric(parse_size($element['#value']))) {
    form_error($element, t('The "!name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).', array(
      '!name' => t($element['title']),
    )));
  }
}