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

Form submission handler for file_delete_form().

File

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

Code

function file_delete_form_submit($form, &$form_state) {
  if ($form_state['values']['confirm'] && ($file = file_load($form_state['values']['fid']))) {
    file_delete($file->fid);
    watchdog('file', 'Administrator deleted file %title.', array('%title' => $file->label()));
    backdrop_set_message(t('%title has been deleted.', array('%title' => $file->label())));
  }

  $form_state['redirect'] = 'admin/content/files';

  // Clear the page and block caches.
  cache_clear_all();
}