1 file_example.module file_example_file_check_exists_submit($form, &$form_state)

Submit handler to check existence of a file.

Related topics

File

modules/examples/file_example/file_example.module, line 408
Examples demonstrating the backdrop File API (and Stream Wrappers).

Code

function file_example_file_check_exists_submit($form, &$form_state) {
  $uri = $form_state['values']['fileops_file'];
  if (is_file($uri)) {
    backdrop_set_message(t('The file %uri exists.', array('%uri' => $uri)));
  }
  else {
    backdrop_set_message(t('The file %uri does not exist.', array('%uri' => $uri)));
  }

}