1 file.pages.inc file_add_form_validate($form, &$form_state)

Validation handler for file_add_form().

File

core/modules/file/file.pages.inc, line 190
Supports file operations including Manage and Delete.

Code

function file_add_form_validate($form, &$form_state) {
  if ($form['#step'] === 1 && empty($form_state['values']['upload'])) {
    form_set_error('upload', t('You need to upload a file.'));
  }
}